Bug 88959

Summary: beignet doesn't build with the clang compiler
Product: Beignet Reporter: Koop Mast <kwm>
Component: BeignetAssignee: Zhigang Gong <zhigang.gong>
Status: RESOLVED FIXED QA Contact:
Severity: normal    
Priority: medium CC: dieterich.joh, rong.r.yang
Version: unspecified   
Hardware: All   
OS: FreeBSD   
Whiteboard:
i915 platform: i915 features:
Attachments: Use static inline instead of just inline.

Description Koop Mast 2015-02-03 23:07:19 UTC
Created attachment 113140 [details] [review]
Use static inline instead of just inline.

Beignet uses the inline keyword. When building on FreeBSD 10.0-R or newer it will be compiled with the clang compiler. When building with clang the build fails unresolved symbols.

../src/libcl.so: undefined reference to `handle_events'
../src/libcl.so: undefined reference to `isBitcodeWrapper'
../src/libcl.so: undefined reference to `isRawBitcode'
../src/libcl.so: undefined reference to `cl_event_is_gpu_command_type'

Switch to static inline instead of inline fixes the build. If I remember the facts correctly, clang defaults to gnu99 standard instead of gcc which default to gnu89 standard. And the inline keywords means something different in gnu89 vs gnu99 standard.
Comment 1 Zhigang Gong 2015-02-06 08:35:02 UTC
The patch LGTM, could you send it to the mail list with your signed-off-by
signature? Thanks.
Comment 2 Zhigang Gong 2015-02-27 09:13:45 UTC
ping for response, thanks.
Comment 3 Rebecca Palmer 2016-10-09 21:34:02 UTC
This now appears to be fixed: 1.2.0 builds with clang 3.8 and works.  (I tested with GNU libstdc++, but comments in bug 94636 suggest LLVM libc++ now also works.)

(It's also gained another Linux-only system call, but an easy one to avoid: https://anonscm.debian.org/cgit/pkg-opencl/beignet.git/tree/debian/patches/support-kfreebsd.patch )

Use of freedesktop.org services, including Bugzilla, is subject to our Code of Conduct. How we collect and use information is described in our Privacy Policy.