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)

Sun 29 Jun 2014 07:31:18 PM UTC, comment #8:

Nicola wrote:

> libgnustep-gui is not linked against libobjc.
> That is done on purpose (eg see #9920).


It is not clear from that bug why it is done on purpose...

> So ... what advantages would this change bring ?


It's the other way around -- what advantages does it bring if not linking?

Richard wrote:

> 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.


GUI uses libobjc directly at least in GSTheme, I think. But apart from that, is your proposal possible at all? Aren't Objective-C libraries/applications expected to be able to call runtime functions without hassle if they wish so? Isn't linking also needed for proper initialization (admittedly, this happens anyway as the app is linked with the runtime)?

Yavor Doganov <yavor>
Tue 27 May 2014 09:47:41 AM UTC, comment #7:

There was no follow up on this...
Nicola's explanation makes a lot of sense, should we reject this feature request?

Riccardo Mottola <rmottola>
Project Member
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 ?

Thanks

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

I stand corrected ... patch applied.
Thanks.

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 rmottola (Posted a comment)
  • -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
      Open/ClosedClosed=>Open
    Thu 21 Aug 2008 09:12:00 AM UTCCaSCategoryMakefiles=>Gui/AppKit
      StatusNone=>Fixed
      Open/ClosedOpen=>Closed
    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