bugGNU gettext - Bugs: bug #30060, messed up LDFLAGS and LIBADD for...

 
 

bug #30060: messed up LDFLAGS and LIBADD for libgettextpo and libgettextsrc

Submitted by:  Funda Wang <fundawang>
Submitted on:  Mon 07 Jun 2010 02:51:35 AM UTC  
 
Category: NoneSeverity: 3 - Normal
Item Group: NoneStatus: In Progress
Privacy: PublicAssigned to: Bruno Haible <haible>
Open/Closed: Open

Add a New Comment (Rich MarkupRich Markup):
   

You are not logged in

Please log in, so followups can be emailed to you.

 

Sun 12 Dec 2010 03:12:48 PM UTC, comment #3:

> The correct command when linking libraries should be:
> $(CC) $(LDFLAGS) $(OBJECTS) $(LIBADD)
> Putting some LIBS into LDFLAGS will lead to the fact that LIBS appearing prior to OBJECTS.


Thanks for providing these details.

The use of LDFLAGS goes back to this thread:
http://lists.gnu.org/archive/html/bug-gnulib/2006-09/msg00132.html

I have transformed your complaint into an Automake bug report:
http://debbugs.gnu.org/cgi/bugreport.cgi?bug=7621

Bruno Haible <haible>
Project AdministratorIn charge of this item.
Mon 07 Jun 2010 10:16:17 AM UTC, comment #2:

./configure --build=x86_64-mandriva-linux-gnu --prefix=/usr --exec-prefix=/usr
--bindir=/usr/bin --sbindir=/usr/sbin --sysconfdir=/etc --datadir=/usr/share --includedir=/usr/include --libdir=/usr/lib64 --libexecdir=/usr/lib64 --localstatedir=/var --sharedstatedir=/usr/com --mandir=/usr/share/man --infodir=/usr/share/info --x-includes=/usr/include --x-libraries=/usr/lib64 --enable-shared --with-included-gettext --disable-csharp --disable-java

There is no error messages when building with Mandriva's default buildtools (mainly libtool). But it will confuse Makefile.

The correct command when linking libraries should be:

$(CC) $(LDFLAGS) $(OBJECTS) ($LIBADD)

Putting some LIBS into LDFLAGS will lead to the fact that LIBS appearing prior to OBJECTS.

http://wiki.mandriva.com/en/Overlinking#Wrong_linking_order

Funda Wang <fundawang>
Mon 07 Jun 2010 09:34:00 AM UTC, comment #1:

Can you tell me what problem you had with the definitions as
they are?

What error message did you get? On which platform? With
--disable-shared or --enable-shared?

Bruno Haible <haible>
Project AdministratorIn charge of this item.
Mon 07 Jun 2010 02:51:35 AM UTC, original submission:

libgettextpo_la_LIBADD = libgnu.la $(WOE32_LIBADD) $(LTLIBUNISTRING)
libgettextpo_la_LDFLAGS = \
-version-info $(LTV_CURRENT):$(LTV_REVISION):$(LTV_AGE) \
-rpath $(libdir) \
@LTLIBINTL@ @LTLIBICONV@ -lc @LTNOUNDEF@

But "@LTLIBINTL@ @LTLIBICONV@ -lc" is linked libraries, rather than LDFLAGS. They should be put into LIBADD. i.e.,

libgettextpo_la_LIBADD = libgnu.la $(WOE32_LIBADD) $(LTLIBUNISTRING) @LTLIBINTL@ @LTLIBICONV@ -lc
libgettextpo_la_LDFLAGS = \
-version-info $(LTV_CURRENT):$(LTV_REVISION):$(LTV_AGE) \
-rpath $(libdir) \
@LTNOUNDEF@

libgettextpo_la_LDFLAGS = \
-version-info $(LTV_CURRENT):$(LTV_REVISION):$(LTV_AGE) \
-rpath $(libdir) @LTNOUNDEF@

The same applies to libgettextsrc, it should read:
libgettextsrc_la_LDFLAGS = \
-release @VERSION@ @LTNOUNDEF@

libgettextsrc_la_LIBADD = \
../gnulib-lib/libgettextlib.la $(LTLIBUNISTRING) @LTLIBINTL@ @LTLIBICONV@ -lc

Funda Wang <fundawang>

 

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

Attach File(s):
   
   
Comment:
   

Attached Files
file #20700:  a.patch added by fundawang (1kB - application/octet-stream - Propsed patch)

 

Depends on the following items: None found

Items that depend on this one: None found

 

Carbon-Copy List
  • -unavailable- added by haible (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 4 latest changes.

    Date Changed By Updated Field Previous Value => Replaced By
    Sun 12 Dec 2010 03:12:48 PM UTChaibleStatusNeed Info=>In Progress
    Mon 07 Jun 2010 09:34:00 AM UTChaibleAssigned toNone=>haible
    Mon 07 Jun 2010 09:33:59 AM UTChaibleStatusNone=>Need Info
    Mon 07 Jun 2010 03:09:32 AM UTCfundawangAttached File-=>Added a.patch, #20700

    Back to the top


    Powered by Savane 3.1-cleanup