! Please note that this is a snapshot of our old Bugzilla server, which is read only since May 29, 2020. Please go to gitlab.xfce.org for our new server !
Unable to compile with ldflag: --as-needed
Status:
RESOLVED: FIXED
Severity:
enhancement
Product:
Xfce4-systemload-plugin
Component:
General

Comments

Description Harold Aling 2006-10-22 12:49:04 CEST
User-Agent:       Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.8.1) Gecko/20060601 Firefox/2.0 (Ubuntu-edgy)
Build Identifier: 

A while aso I read somewhere that if I compile with --as-needed in the ldflags, apps link much less libraries so they will start faster...

I completely compiled Xfce from svn using these linker flags: "-Wl,-O1 -Wl,--enable-new-dtags -Wl,--sort-common -Wl,--as-needed -s";

All built just fine, except for the systemload plugin...

Reproducible: Always

Steps to Reproduce:
1. use these ldflags: "-Wl,-O1 -Wl,--enable-new-dtags -Wl,--sort-common -Wl,--as-needed -s"
2. compile xfce4-systemload-plugin
3. unable to complete the compile

Actual Results:  
~500 lines like these:
xfce4_systemload_plugin-systemload.o: In function `main':
systemload.c:(.text+0x1c): undefined reference to `gtk_init'
systemload.c:(.text+0x35): undefined reference to `xfce_external_panel_plugin_new'
systemload.c:(.text+0x6b): undefined reference to `g_signal_connect_data'
...
Comment 1 Nick Schermer editbugs 2006-12-20 09:31:29 CET
Reassign to myself. Also need to fix LINGUAS support.
Comment 2 Nick Schermer editbugs 2006-12-20 20:31:44 CET
Fixed with rev 2265
Comment 3 Harold Aling 2006-12-22 10:36:20 CET
r2267 still doesn't compile with
"-Wl,-O1 -Wl,--enable-new-dtags -Wl,--sort-common -Wl,--as-needed -s"

It does work with
"-Wl,-O1 -Wl,--enable-new-dtags -Wl,--sort-common"

Error: xfce4_systemload_plugin-systemload.o: In function `main':


It's really no big a deal, you may close the bug again if you do not wish to fix this...

-H-
Comment 4 Gergan Penkov 2007-01-05 21:24:20 CET
Created attachment 925 
patch to resolve the --as-needed issue

this should resolve it, there some more plugins (virtually the majority), which use this kind of Makefile.am template, which is not correct, LDFLAGS should not be used as LDADD - I simply do not know how or where to report all of them in one bug-report.
Comment 5 Gergan Penkov 2007-01-05 21:25:08 CET
sorry for the bugspam, I have forgotten to add myself to the bug
Comment 6 Nick Schermer editbugs 2007-01-09 18:25:16 CET
Patch applied in revision 2324.

Bug #2461

Reported by:
Harold Aling
Reported on: 2006-10-22
Last modified on: 2010-10-28

People

Assignee:
Nick Schermer
CC List:
2 users

Version

Version:
0.4.2 or older
Target Milestone:
0.4.2 or older

Attachments

patch to resolve the --as-needed issue (366 bytes, patch)
2007-01-05 21:24 CET , Gergan Penkov
no flags

Additional information