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: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: [OLD] Library (show other bugs)
Hardware: AMD64 Linux
: Normal normal
Assignee: Gentoo wxWidgets project
URL:
Whiteboard:
Keywords: PullRequest
Depends on:
Blocks:
 
Reported: 2014-03-11 13:22 UTC by Christian
Modified: 2022-08-23 15:19 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.
Comment 6 Sam James archtester Gentoo Infrastructure gentoo-dev Security 2022-08-14 17:21:46 UTC
(In reply to throwd from comment #5)
> 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.

Please share emerge --info and attach the full build.log.
Comment 7 Sam James archtester Gentoo Infrastructure gentoo-dev Security 2022-08-14 17:49:14 UTC
(In reply to Sam James from comment #6)

sorry, I'd missed that the update to the bug was because of Emily's PR, and not this comment. Whoops.
Comment 8 Larry the Git Cow gentoo-dev 2022-08-23 15:19:35 UTC
The bug has been closed via the following commit(s):

https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=8b215f0743a4266e48ff3377811a7ce73f287d1f

commit 8b215f0743a4266e48ff3377811a7ce73f287d1f
Author:     Emily Rowlands <emily@erowl.net>
AuthorDate: 2022-08-23 15:19:23 +0000
Commit:     David Seifert <soap@gentoo.org>
CommitDate: 2022-08-23 15:19:23 +0000

    x11-libs/wxGTK: Disable precompiled headers
    
    This commit adds USE=pch to disable precompiled headers. PCHes are
    unstable and as such, USE=pch is masked globally.
    
    This bug can alternatively be fixed by filtering various FLAGs
    (-Wl,-O1 -Wl,-z,relro, and similar).
    
    Closes: https://bugs.gentoo.org/504204
    Signed-off-by: Emily Rowlands <emily@erowl.net>
    Signed-off-by: David Seifert <soap@gentoo.org>

 x11-libs/wxGTK/wxGTK-3.0.4-r3.ebuild | 7 ++++++-
 x11-libs/wxGTK/wxGTK-3.0.5.1.ebuild  | 7 ++++++-
 2 files changed, 12 insertions(+), 2 deletions(-)