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

Group
 
 

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

Submitter:  Funda Wang <fundawang>
Submitted:  Wed 20 Aug 2008 11:41:21 AM UTC
   
 
Category:  Makefiles Severity:  3 - Normal
Item Group:  Change Request Status:  In Progress
Privacy:  Public Assigned to:  None
Open/Closed:  Open
* Mandatory Fields

Add a New Comment Rich Markup
   

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

 

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

Attach Files:
   
   
Comment:
   

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 (81KiB - application/bzip2 - full_build_log)

 

Depends on the following items: None found

Items that depend on this one: None found

 

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

    Date Changed by Updated Field Previous Value => Replaced by
    2008-08-25 nico CategoryGui/AppKit Makefiles
        Item GroupNone Change Request
        StatusFixed In Progress
        Open/ClosedClosed Open
    2008-08-21 CaS CategoryMakefiles Gui/AppKit
        StatusNone Fixed
        Open/ClosedOpen Closed
    2008-08-21 yavor Attached File- Added no-undefined.patch, #16326
    2008-08-21 CaS CategoryGui/AppKit Makefiles
    2008-08-20 fundawang Attached File- Added build.0.20080820113220.log.bz2, #16322

    Back to the top

    Powered by Savane 3.13-54b4.
    Corresponding source code