Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 504204 - x11-libs/wxGTK-3.0.0.0 - x86_64-pc-linux-gnu-ranlib: /usr/lib64/crt1.o: In function `_start': (.text+0x20): undefined reference to `main'
Summary: x11-libs/wxGTK-3.0.0.0 - x86_64-pc-linux-gnu-ranlib: /usr/lib64/crt1.o: In fu...
Status: UNCONFIRMED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: [OLD] Library (show other bugs)
Hardware: AMD64 Linux
: Normal normal with 2 votes (vote)
Assignee: Gentoo wxWidgets Herd
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2014-03-11 13:22 UTC by Christian
Modified: 2020-11-10 13:56 UTC (History)
5 users (show)

See Also:
Package list:
Runtime testing required: ---


Attachments
complete build.log (build.log,277.55 KB, text/plain)
2014-03-11 13:22 UTC, Christian
Details
emerge -info (emerge.info,21.04 KB, text/plain)
2014-03-11 13:23 UTC, Christian
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Christian 2014-03-11 13:22:17 UTC
I can't compile wxGTK-3.0.0.0 because of this undefined reference to main.
the relevant part is this, I think:

/var/tmp/portage/x11-libs/wxGTK-3.0.0.0/work/wxPython-src-3.0.0.0/wxgtk_build/bk-make-pch ./.pch/wxprec_basedll/wx/wxprec.h.gch wx/wxprec.h x86_64-pc-linux-gnu-g++ -I./.pch/wxprec_basedll -D__WXGTK__      -DWXBUILDING      -I/var/tmp/portage/x11-libs/wxGTK-3.0.0.0/work/wxPython-src-3.0.0.0/src/regex  -DwxUSE_GUI=0 -DWXMAKINGDLL_BASE -DwxUSE_BASE=1 -fPIC -DPIC -Wall -Wundef -Wunused-parameter -Wno-ctor-dtor-privacy -Woverloaded-virtual -D_FILE_OFFSET_BITS=64 -I/var/tmp/portage/x11-libs/wxGTK-3.0.0.0/work/wxPython-src-3.0.0.0/wxgtk_build/lib/wx/include/gtk2-unicode-3.0 -I/var/tmp/portage/x11-libs/wxGTK-3.0.0.0/work/wxPython-src-3.0.0.0/include -D_REENTRANT -pthread -I/usr/include/gtk-2.0 -I/usr/lib64/gtk-2.0/include -I/usr/include/pango-1.0 -I/usr/include/atk-1.0 -I/usr/include/cairo -I/usr/include/pixman-1 -I/usr/include/directfb -I/usr/include/libdrm -I/usr/include/gdk-pixbuf-2.0 -I/usr/include/pango-1.0 -I/usr/include/harfbuzz -I/usr/include/pango-1.0 -I/usr/include/freetype2 -I/usr/include/libpng16 -I/usr/include/freetype2 -I/usr/include/libpng16 -I/usr/include/glib-2.0 -I/usr/lib64/glib-2.0/include -I/usr/X11R6/include -DWX_PRECOMP -pthread -pthread -I/usr/include/gdk-pixbuf-2.0 -I/usr/include/libpng16 -I/usr/include/glib-2.0 -I/usr/lib64/glib-2.0/include -D_REENTRANT -pthread -I/usr/include/gtk-unix-print-2.0 -I/usr/include/gtk-2.0 -I/usr/lib64/gtk-2.0/include -I/usr/include/pango-1.0 -I/usr/include/atk-1.0 -I/usr/include/cairo -I/usr/include/pixman-1 -I/usr/include/directfb -I/usr/include/libdrm -I/usr/include/gdk-pixbuf-2.0 -I/usr/include/pango-1.0 -I/usr/include/harfbuzz -I/usr/include/pango-1.0 -I/usr/include/glib-2.0 -I/usr/lib64/glib-2.0/include -I/usr/include/freetype2 -I/usr/include/libpng16 -I/usr/include/freetype2 -I/usr/include/libpng16 -I/usr/include/SDL -D_GNU_SOURCE=1 -D_REENTRANT -O2 -pipe -fomit-frame-pointer -march=native -Wl,-O1 -Wl,--as-needed -fvisibility=hidden -fvisibility-inlines-hidden
/usr/lib/gcc/x86_64-pc-linux-gnu/4.8.2/../../../../lib64/crt1.o: In function `_start':
(.text+0x20): undefined reference to `main'
collect2: error: ld returned 1 exit status
Makefile:15504: recipe for target '.pch/wxprec_basedll/wx/wxprec.h.gch' failed
make: *** [.pch/wxprec_basedll/wx/wxprec.h.gch] Error 1

Reproducible: Always
Comment 1 Christian 2014-03-11 13:22:50 UTC
Created attachment 372376 [details]
complete build.log
Comment 2 Christian 2014-03-11 13:23:46 UTC
Created attachment 372378 [details]
emerge -info
Comment 3 Rick Harris 2015-07-16 05:34:54 UTC
Me too!

Removing '-Wl,-O1' from CXXFLAGS fixes this for me.
Comment 4 . 2015-10-10 11:50:18 UTC
(In reply to Rick Harris from comment #3)
> Me too!
> 
> Removing '-Wl,-O1' from CXXFLAGS fixes this for me.

Yes, I can confirm this resolves the issue. Thanks.

P.S. In my case those flags were introduced into CXXFLAGS by portage-bashrc-mv.
Comment 5 throwd 2019-06-21 02:37:28 UTC
I still run into this issue for x11-libs/wxGTK-3.0.4-r300

It's not clear how I'm supposed to remove '-Wl,-O1' from the CXXFLAGS since I'm not adding it via make.conf.