After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 134332 - CFLAGS must not include -L/-l flags
CFLAGS must not include -L/-l flags
Status: RESOLVED FIXED
Product: at-spi
Classification: Platform
Component: build
1.3.x
Other All
: Normal normal
: ---
Assigned To: bill.haneman
bill.haneman
: 132234 (view as bug list)
Depends on:
Blocks:
 
 
Reported: 2004-02-13 17:14 UTC by Julio Merino
Modified: 2004-12-22 21:47 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
Patch for configure.in (539 bytes, patch)
2004-02-13 17:15 UTC, Julio Merino
none Details | Review
proposed patch for this issue (1.34 KB, patch)
2004-03-24 14:31 UTC, bill.haneman
none Details | Review

Description Julio Merino 2004-02-13 17:14:38 UTC
The configure script in at-spi adds the value of X_LIBS to CFLAGS.  This 
is wrong from a conceptual point of view, since these flags are only 
passed to the compiler (not the linker).  But this also breaks the build. 
 
Libtool 1.5.x breaks when -L/-l flags are passed on the command line at 
the end of it.  Consider the following: 
 
$ libtool --mode=compile gcc -c foo.c -lm 
libtool: compile: cannot determine name of library object from `-lm' 
 
Even though, this works: 
 
$ libtool --mode=compile gcc -lm -c foo.c 
 
It is very risky to assume it will always work.  Therefore, those flags 
must be removed from the CFLAGS variable.  I've done it, and at-spi 
builds without problems. 
 
I don't know why that line was added to configure.in.  But even if it is 
there to fix something, there must be a better way to do the same by 
setting LDFLAGS and/or LIBS.
Comment 1 Julio Merino 2004-02-13 17:15:10 UTC
Created attachment 24387 [details] [review]
Patch for configure.in
Comment 2 bill.haneman 2004-02-16 16:04:25 UTC
We currently use libtool 1.5.X without incident.
Comment 3 Julio Merino 2004-02-16 16:18:29 UTC
This is working for you because this depends on the order of the 
arguments.  And this is a very delicate thing and subject to 
break... 
 
Here in pkgsrc, the order changes because there are compiler 
wrappers to help in many other things, and when they rewrite the 
call, some flags get moved from their original place.  But anyway, 
this could happen by other reasons and in other systems. 
 
May I ask why that line is in configure?  It seems to not be needed. 
Comment 4 bill.haneman 2004-02-16 16:34:47 UTC
Hi Julio:

Offhand I don't know why X_LIBS is added to CFLAGS instead of added
elsewhere.  But I feel pretty confident that removing it will break
_someone's_ build :-/

I agree that it doesn't look quite right.
Comment 5 Julio Merino 2004-02-16 17:03:33 UTC
I see now.  That line was added on revision 1.61 of configure, to fix 
bug #105836.  Although, from what I read there, the same thing could 
be achieved by adding X_LIBS to LIBS (or LDFLAGS), not CFLAGS, since 
autoconf's test compilations automatically use their values... 
Comment 6 bill.haneman 2004-03-15 12:17:09 UTC
I'd prefer to fix this in 2.6.1 unless some serious build gurus go
over it closely.
Comment 7 bill.haneman 2004-03-24 14:31:49 UTC
Created attachment 25917 [details] [review]
proposed patch for this issue

please test the attached patch to confirm that it works for you.  Thanks!
Comment 8 bill.haneman 2004-03-24 14:32:10 UTC
*** Bug 132234 has been marked as a duplicate of this bug. ***
Comment 9 bill.haneman 2004-03-24 15:59:14 UTC
Please reopen if this does not work for you.  Fixed in CVS.