Clang support

Bug #658414 reported by Stas Boukarev
8
This bug affects 1 person
Affects Status Importance Assigned to Milestone
SBCL
Fix Released
Wishlist
Unassigned

Bug Description

SBCL can be built with Clang (tested with the latest version, 2.8 on linux-x86) with minor tweaks.

The attached patch changes "inline" declartion into "extern inline", otherwise clang removes such symbols from the binary. And for the build infrastructure, don't set CC to gcc unconditionally, only in case it's unset.

To build with clang it's sufficient to set CC variable to "clang" and run make.sh

Tags: review
Revision history for this message
James Y Knight (foom) wrote :

The inline change isn't correct. In traditional GCC inline semantics, "inline" does get an external symbol emitted. "extern inline" *doesn't*. In C99's inline semantics, it's exactly the opposite. So, with that change, the symbol now won't be emitted in GCC (unless compiled on recent GCCs in C99 mode).

Since this is only supposed to be inline in one file, I think it can be solved by simply changing the declaration in the header file to omit the word "inline", while leaving the definitions marked as simply "inline". That should do the right thing both in traditional GCC rules and C99 rules.

See also: http://www.greenend.org.uk/rjk/2003/03/inline.html

Revision history for this message
Stas Boukarev (stassats) wrote :

Sorry, I should've checked on GCC before posting. I attached a corrected version based on the commentary above.

Changed in sbcl:
status: New → Confirmed
importance: Undecided → Wishlist
Stas Boukarev (stassats)
Changed in sbcl:
status: Confirmed → Fix Committed
Stas Boukarev (stassats)
Changed in sbcl:
status: Fix Committed → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.