Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Build error #46

Open
dbermond opened this issue Jan 3, 2020 · 3 comments
Open

Build error #46

dbermond opened this issue Jan 3, 2020 · 3 comments

Comments

@dbermond
Copy link

dbermond commented Jan 3, 2020

I'm getting the following error when trying to build firetools 0.9.62:

g++ -Wl,-O1,--sort-common,--as-needed,-z,relro,-z,now -lrt -Wl,-z,relro -Wl,-z,now -Wl,-O1 -Wl,-O1,--sort-common,--as-needed,-z,relro,-z,now -o ../../build/fstats main.o stats_dialog.o pid_thread.o db.o dbpid.o graph.o utils.o pid.o config.o qrc_fstats.o moc_pid_thread.o moc_stats_dialog.o   /usr/lib/libQt5Widgets.so /usr/lib/libQt5Gui.so /usr/lib/libQt5Core.so -lGL -lpthread -lmd4c   
/usr/bin/ld: stats_dialog.o: undefined reference to symbol 'shm_open@@GLIBC_2.2.5'
/usr/bin/ld: /usr/lib/gcc/x86_64-pc-linux-gnu/9.2.0/../../../../lib/librt.so: error adding symbols: DSO missing from command line
collect2: error: ld returned 1 exit status
make[2]: *** [Makefile:182: ../../build/fstats] Error 1
make[2]: Leaving directory '/build/firetools/src/firetools-0.9.62/src/fstats'
make[1]: *** [Makefile:5: fstats] Error 2
make[1]: Leaving directory '/build/firetools/src/firetools-0.9.62/src'
make: *** [Makefile:17: src] Error 2
  • This is caused by commit 15a4571.

  • Reverting commit 15a4571 "fixes" the issue.

  • Executing export LDFLAGS="-lrt ${LDFLAGS}" before building also "fixes" this issue.

  • System Information:

    • OS: Arch Linux x86_64
    • compiler: gcc 9.2.0
    • Qt: 5.14.0 (qmake: 3.1)
@darix
Copy link

darix commented Feb 11, 2020

Try this patch. It fixes the build for me on openSUSE Tumbleweed:

Index: firetools-0.9.62/src/fstats/fstats.pro
===================================================================
--- firetools-0.9.62.orig/src/fstats/fstats.pro
+++ firetools-0.9.62/src/fstats/fstats.pro
@@ -1,6 +1,7 @@
 QMAKE_CXXFLAGS += $$(CXXFLAGS) -fstack-protector-all -D_FORTIFY_SOURCE=2 -fPIE -pie -Wformat -Wformat-security
 QMAKE_CFLAGS += $$(CFLAGS) -fstack-protector-all -D_FORTIFY_SOURCE=2 -fPIE -pie -Wformat -Wformat-security
-QMAKE_LFLAGS += $$(LDFLAGS) -lrt -Wl,-z,relro -Wl,-z,now
+QMAKE_LFLAGS += $$(LDFLAGS) -Wl,-z,relro -Wl,-z,now
+LIBS= -lrt -lc
 QT += widgets
  HEADERS       = ../common/utils.h ../common/pid.h ../common/common.h \
  		  pid_thread.h db.h dbstorage.h dbpid.h stats_dialog.h graph.h fstats.h

Explanation why I moved the "-lrt" to LIBS ... it needs to be after the -o expression if you link with "as-needed"

@dbermond
Copy link
Author

This patch fixes the issue for me. Git master is also building fine for me now.

Thank you for working on this.

@reinerh
Copy link
Collaborator

reinerh commented Feb 22, 2020

Hm, it builds fine in Debian with Qt 5.12 / gcc 9.2.
I'm wondering why adding -lrt to QMAKE_LIBS does not work for you (-lc shouldn't be needed?).
Maybe they changed something in Qt 5.14?
@darix, could you please open a PR with your fix?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants