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

 
 

You are not allowed to post comments on this tracker with your current authentication level.

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

Submitted by:  Quentin Mathé <qmathe>
Submitted on:  Fri 14 Oct 2011 08:47:48 AM UTC  
 
Category: NoneSeverity: 3 - Normal
Item Group: BugStatus: Fixed
Privacy: PublicAssigned to: None
Open/Closed: Closed

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

Works fine for me now. Thanks.

Quentin Mathé <qmathe>
Project 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>
Project 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>
Project 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>
Project 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>
Project Member

 

No files currently attached

 

Depends on the following items: None found

Items that depend on this one: None found

 

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

    Do you think this task is very important?
    If so, you can click here to add your encouragement to it.
    This task has 0 encouragements so far.

    Only logged-in users can vote.

     

    Please enter the title of George Orwell's famous dystopian book (it's a date):

     

     

    Follow 4 latest changes.

    Date Changed By Updated Field Previous Value => Replaced By
    Thu 20 Oct 2011 08:54:26 AM UTCqmatheOpen/ClosedIn Test=>Closed
    Sat 15 Oct 2011 06:51:28 PM UTCCaSStatusNone=>Fixed
      Open/ClosedOpen=>In Test
    Fri 14 Oct 2011 03:41:45 PM UTCCaSCategoryBase/Foundation=>None

    Back to the top


    Powered by Savane 3.1-cleanup1