bugGNUstep - Bugs: bug #34544, glibc related compilation failure...

Group
 
 

bug #34544: glibc related compilation failure with Clang and the non-fragile ABI

Submitter:  Quentin Mathé <qmathe>
Submitted:  Fri 14 Oct 2011 08:47:48 AM UTC
   
 
Category:  None Severity:  3 - Normal
Item Group:  Bug Status:  Fixed
Privacy:  Public Assigned to:  None
Open/Closed:  Closed
* Mandatory Fields

Add a New Comment Rich Markup
   

Thu 20 Oct 2011 08:54:26 AM UTC, comment #4: 

Works fine for me now. Thanks.

Quentin Mathé <qmathe>
Group Member
Sat 15 Oct 2011 06:51:28 PM UTC, comment #3: 

Thanks .. I added your improvement.  I hope that's OK now.

Richard Frith-Macdonald <CaS>
Group Member
Sat 15 Oct 2011 09:51:24 AM UTC, comment #2: 

Thanks Richard for the workaround you added with r33993.

However there is still a small problem, I get the warning below for every compiled .m file:

 Compiling file NSPropertyList+GNUstepBase.m ...
In file included from NSPropertyList+GNUstepBase.m:26:
.././common.h:55:9: warning: '__block' macro redefined
#define __block __gs_unistd_block
        ^
<built-in>:16:9: note: previous definition is here
#define _block __attribute_((_blocks_(byref)))

I eliminated the issue by changing common.h to undef __block first:

#ifdef HAVE_UNISTD_H
#ifdef __block
/* Turn off Clang built-in __block */
#undef __block
#endif
#define __block __gs_unistd_block
#include <unistd.h>
#undef __block
#endif

Thanks,
Quentin

Quentin Mathé <qmathe>
Group Member
Fri 14 Oct 2011 03:41:45 PM UTC, comment #1: 

I guess this is strictly a compiler bug, and there's really gnustep can do about it (but we can add work arounds to avoid it within gnustep code).

Richard Frith-Macdonald <CaS>
Group Member
Fri 14 Oct 2011 08:47:48 AM UTC, original submission:  

Hi,

Ubuntu 10.4 x86-32
GNUstep core svn r33979
Clang svn r138561

When GNUstep Make is configured with CC=clang and --enable-objc-nonfragile-abi, I'm unable to compile Base, an error is reported every time unistd.h is included as shown below. Without passing --enable-objc-nonfragile-abi to GNUstep Make, Base compiles just fine.

This seems to be due to a glibc bug described here (still unsolved apparently): http://sources.redhat.com/bugzilla/show_bug.cgi?id=11157
At the end of the bug report, a workaround is suggested, it does work fine but changing every files where unistd.h is included looks like a poor solution.

clang NSStream.m -c \
          -MMD -MP -Wall -Wdeclaration-after-statement -DGNUSTEP -DGNUSTEP_BASE_LIBRARY=1 -DGNU_GUI_LIBRARY=1 -DGNU_RUNTIME=1 -DGNUSTEP_BASE_LIBRARY=1 -fno-strict-aliasing -fobjc-nonfragile-abi -D_NONFRAGILE_ABI -fPIC -DDEBUG -fno-omit-frame-pointer -Wall -DGSWARN -DGSDIAGNOSE -Wno-import -g -fgnu-runtime -fobjc-nonfragile-abi -fgnu-runtime -fconstant-string-class=NSConstantString -I../. -I../../Headers -I. -I/System/Library/Headers -I/Local/Library/Headers -I/Local/Library/Headers -I/System/Library/Headers -I/usr/include/libxml2 -I/home/qmathe/GNUstep/Library/Headers -I/Local/Library/Headers -I/System/Library/Headers \
           -o obj/unix.obj/NSStream.m.o
In file included from NSStream.m:27:
/usr/include/unistd.h:1128:35: error: __block attribute not allowed, only
      allowed on local variables
extern void encrypt (char *__block, int __edflag) __THROW __nonnull ((1));

Thanks,
Quentin.

Quentin Mathé <qmathe>
Group Member

 

(Note: upload size limit is set to 16384 kB, after insertion of the required escape characters.)

Attach Files:
   
   
Comment:
   

No files currently attached

 

Depends on the following items: None found

Items that depend on this one: None found

 

Carbon-Copy List
  • -email is unavailable- added by CaS (Posted a comment)
  • -email is unavailable- added by qmathe (Submitted the item)
  •  

    There are 0 votes so far. Votes easily highlight which items people would like to see resolved in priority, independently of the priority of the item set by tracker managers.

    Only logged-in users can vote.

     

    Follow 4 latest changes.

    Date Changed by Updated Field Previous Value => Replaced by
    2011-10-20 qmathe Open/ClosedIn Test Closed
    2011-10-15 CaS StatusNone Fixed
        Open/ClosedOpen In Test
    2011-10-14 CaS CategoryBase/Foundation None

    Back to the top

    Powered by Savane 3.13-02a9.
    Corresponding source code