bugGNUstep - Bugs: bug #24109, gnustep-gui 0.14.0 does not build...


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

bug #24109: gnustep-gui 0.14.0 does not build with LDFLAGS="-Wl,--as-needed -Wl,--no-undefined"

Submitted by:  Funda Wang <fundawang>
Submitted on:  Wed 20 Aug 2008 11:41:21 AM UTC  
Category: MakefilesSeverity: 3 - Normal
Item Group: Change RequestStatus: In Progress
Privacy: PublicAssigned to: None
Open/Closed: Open

(Jump to the original submission Jump to the original submission)

Tue 26 Aug 2008 05:31:36 AM UTC, comment #6:

I can't speak for this particular case, but...

As per Debian Policy it is a bug if a program or a library has unresolved symbols; this is to ensure that the shlibs system works properly and all dependencies for the package are computed correctly (there are some exceptions like python extensions, etc.)

Many packages pass `-Wl,--as-needed' during build to strip unnecessary dependencies, and additionally `-Wl,-z,defs' for extra safety. It appears that this has become common practice for Fedora and Mandriva too. Superfluous dependencies just make library transitions harder (and user's experience too, as they install extra packages they don't need), and missing dependencies cause mystical runtime failures that are sometimes hard to debug. (The latter is almost impossible in this case, but still...)

Yavor Doganov <yavor>
Mon 25 Aug 2008 10:51:35 PM UTC, comment #5:

I'm confused ... this looks like a request for a change in behaviour, not a bug report ;-)

libgnustep-gui is not linked against libobjc. That is done on purpose (eg see #9920).
Only the final executable program is linked against all the libraries. We can discuss
if this is good or bad, but it's currently the expected behaviour; we need to have a
longer discussion if we want to change it - it's not a bug fix, it's a change. :-)

If we want to change it, I guess we want to change it for all ObjC libraries, not just
gnustep-gui. So the change would go in gnustep-make. It doesn't really make
much sense to change gnustep-gui only.

So ... what advantages would this change bring ?


Nicola Pero <nico>
Project Member
Thu 21 Aug 2008 09:12:00 AM UTC, comment #4:

I stand corrected ... patch applied.

Though ... I wonder if gui ought to depend on libobjc directly. If we changed the compatibility layer in GSObjCRuntime.h in the base library so that we wrapped all of the runtime functions, libraries would be able to link with just base and not libobjc.

Richard Frith-Macdonald <CaS>
Project Member
Thu 21 Aug 2008 08:32:43 AM UTC, comment #3:

It's not GNUstep Make's fault. It is the developer's responsibility to ensure that LIBRARIES_DEPEND_UPON contains all the libraries the built library has to link with; gnustep-make does not add anything by default (and that's how it should be, as it has no knowledge about the required libs).

The attached patch works for me.

(file #16326)

Yavor Doganov <yavor>
Thu 21 Aug 2008 08:06:23 AM UTC, comment #2:

but gnustep-base and gnustep-back does not have this problem.

Funda Wang <fundawang>
Thu 21 Aug 2008 06:43:45 AM UTC, comment #1:

I think this is probably a gnustep-make issue ... as presumably that is what should be ensuring that the objc library is linked in the correct order

Richard Frith-Macdonald <CaS>
Project Member
Wed 20 Aug 2008 11:41:21 AM UTC, original submission:

When LDFLAGS is set to "-Wl,--as-needed -Wl,--no-undefined", gnustep-gui 0.14.0 produces a lot of undefined refereces, such as:
obj/NSDocument.o: In function `-[NSDocument makeWindowControllers]':
/home/fwang/gnustep-gui/BUILD/gnustep-gui-0.14.0/Source/NSDocument.m:371: undefined reference to `objc_get_class'
/home/fwang/gnustep-gui/BUILD/gnustep-gui-0.14.0/Source/NSDocument.m:371: undefined reference to `objc_msg_lookup'
/home/fwang/gnustep-gui/BUILD/gnustep-gui-0.14.0/Source/NSDocument.m:371: undefined reference to `objc_msg_lookup'
/home/fwang/gnustep-gui/BUILD/gnustep-gui-0.14.0/Source/NSDocument.m:373: undefined reference to `objc_msg_lookup'
/home/fwang/gnustep-gui/BUILD/gnustep-gui-0.14.0/Source/NSDocument.m:374: undefined reference to `objc_msg_lookup'
/home/fwang/gnustep-gui/BUILD/gnustep-gui-0.14.0/Source/NSDocument.m:378: undefined reference to `objc_get_class'
/home/fwang/gnustep-gui/BUILD/gnustep-gui-0.14.0/Source/NSDocument.m:378: undefined reference to `objc_msg_lookup'
/home/fwang/gnustep-gui/BUILD/gnustep-gui-0.14.0/Source/NSDocument.m:378: undefined reference to `objc_msg_lookup'
obj/NSDocument.o: In function `-[NSDocument showWindows]':
/home/fwang/gnustep-gui/BUILD/gnustep-gui-0.14.0/Source/NSDocument.m:391: undefined reference to `objc_msg_lookup'
obj/NSDocument.o: In function `-[NSDocument updateChangeCount:]':
/home/fwang/gnustep-gui/BUILD/gnustep-gui-0.14.0/Source/NSDocument.m:402: undefined reference to `objc_msg_lookup'
/home/fwang/gnustep-gui/BUILD/gnustep-gui-0.14.0/Source/NSDocument.m:427: undefined reference to `objc_msg_lookup'
obj/NSDocument.o:/home/fwang/gnustep-gui/BUILD/gnustep-gui-0.14.0/Source/NSDocument.m:431: more undefined references to `objc_msg_lookup' follow

Maybe some more -l libs should be used?

Funda Wang <fundawang>


Attached Files
file #16326:  no-undefined.patch added by yavor (894B - text/x-patch - Avoid FTBFS when symbol resolution is enforced at build time)
file #16322:  build.0.20080820113220.log.bz2 added by fundawang (81kB - application/bzip2 - full_build_log)


Depends on the following items: None found

Items that depend on this one: None found


Carbon-Copy List
  • -unavailable- added by nico (Posted a comment)
  • -unavailable- added by yavor (Updated the item)
  • -unavailable- added by CaS (Posted a comment)
  • -unavailable- added by fundawang (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 10 latest changes.

    Date Changed By Updated Field Previous Value => Replaced By
    Mon 25 Aug 2008 10:51:35 PM UTCnicoCategoryGui/AppKit=>Makefiles
      Item GroupNone=>Change Request
      StatusFixed=>In Progress
    Thu 21 Aug 2008 09:12:00 AM UTCCaSCategoryMakefiles=>Gui/AppKit
    Thu 21 Aug 2008 08:32:43 AM UTCyavorAttached File-=>Added no-undefined.patch, #16326
    Thu 21 Aug 2008 06:43:45 AM UTCCaSCategoryGui/AppKit=>Makefiles
    Wed 20 Aug 2008 11:48:59 AM UTCfundawangAttached File-=>Added build.0.20080820113220.log.bz2, #16322

    Back to the top

    Powered by Savane 3.1-cleanup