Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 238297 - sys-devel/gcc-4.3.2 doesn't compile on amd64/multilib profiles with gcj USE flag ON(needs 32bit libXtst --> app-emulation/emul-linux-x86-xlibs ?)
Summary: sys-devel/gcc-4.3.2 doesn't compile on amd64/multilib profiles with gcj USE f...
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: [OLD] Core system (show other bugs)
Hardware: All Linux
: High normal with 1 vote (vote)
Assignee: Gentoo Toolchain Maintainers
URL:
Whiteboard:
Keywords:
: 232315 245613 (view as bug list)
Depends on:
Blocks: 444350
  Show dependency tree
 
Reported: 2008-09-21 17:19 UTC by Andrey Vul
Modified: 2012-11-24 21:21 UTC (History)
5 users (show)

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


Attachments
gcc-4.3.2-multilib-gcj.patch (gcc-4.3.2-multilib-gcj.patch,548 bytes, patch)
2008-11-04 11:05 UTC, Chí-Thanh Christopher Nguyễn
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Andrey Vul 2008-09-21 17:19:39 UTC
When gcc goes to build libjava, the configure script has a bug in it.
This snippet causes the bug:
/* Override any gcc2 internal prototype to avoid an error.  */
#ifdef __cplusplus
extern "C"
#endif
/* We use char because int might match the return type of a gcc2
   builtin and then its argument prototype would still apply.  */
char XTestQueryExtension ();
int
main ()
{
XTestQueryExtension ();
  ;
  return 0;
}

Now, when I manually compile this code block (linking with Xtst), the result is a segfault. Because this does not return 0 by definition in either compile or run, the code proceeds to the following block: 
  { { echo "$as_me:$LINENO: error: libXtst not found, required by java.awt.Robot" >&5
echo "$as_me: error: libXtst not found, required by java.awt.Robot" >&2;}
   { (exit 1); exit 1; }; }
Comment 1 Andrey Vul 2008-09-21 17:42:22 UTC
build.log:
checking for libart-2.0 >= 2.1... yes
checking LIBART_CFLAGS... -I/usr/include/libart-2.0
checking LIBART_LIBS... -lart_lgpl_2
checking for XTestQueryExtension in -lXtst... no
configure: error: libXtst not found, required by java.awt.Robot
make[1]: *** [configure-target-libjava] Error 1
make[1]: Leaving directory `/var/tmp/portage/sys-devel/gcc-4.3.1-r1/work/build'
make: *** [profiledbootstrap] Error 2
 *
 * ERROR: sys-devel/gcc-4.3.1-r1 failed.
 * Call stack:
 *               ebuild.sh, line   49:  Called src_compile
 *             environment, line 4623:  Called toolchain_src_compile
 *             environment, line 5139:  Called gcc_src_compile
 *             environment, line 2956:  Called gcc_do_make
 *             environment, line 2779:  Called die
 * The specific snippet of code:
 *       emake LDFLAGS="${LDFLAGS}" STAGE1_CFLAGS="${STAGE1_CFLAGS}" LIBPATH="${LIBPATH}" BOOT_CFLAGS="${BOOT_CFLAGS}" ${GCC_MAKE_TARGET} || die "emake failed with ${GCC_MAKE_TARGET}";
 *  The die message:
 *   emake failed with profiledbootstrap
 *
 * If you need support, post the topmost build error, and the call stack if relevant.
 * A complete build log is located at '/var/tmp/portage/sys-devel/gcc-4.3.1-r1/temp/build.log'.
 * The ebuild environment file is located at '/var/tmp/portage/sys-devel/gcc-4.3.1-r1/temp/environment'.
 *
Comment 2 Chí-Thanh Christopher Nguyễn gentoo-dev 2008-11-03 17:49:18 UTC
same error here with sys-devel/gcc-4.3.2 on amd64
Comment 3 Chí-Thanh Christopher Nguyễn gentoo-dev 2008-11-04 11:05:53 UTC
Created attachment 170711 [details, diff]
gcc-4.3.2-multilib-gcj.patch

From config.log:
configure:25129: checking for XTestQueryExtension in -lXtst
configure:25164: /var/tmp/portage/sys-devel/gcc-4.3.2/work/build/./gcc/xgcc -B/var/tmp/portage/sys-devel/gcc-4.3.2/work/build/./gcc/ -B/usr/x86_64-pc-linux-gnu/bin/ -B/usr/x86_64-pc-linux-gnu/lib/ -isystem /usr/x86_64-pc-linux-gnu/include -isystem /usr/x86_64-pc-linux-gnu/sys-include  -m32 -o conftest -O2 -g -O2 -pipe-march=core2     conftest.c -lXtst  -L/usr/X11R6/lib  >&5
/usr/x86_64-pc-linux-gnu/bin/ld: skipping incompatible /usr/X11R6/lib/libXtst.so when searching for -lXtst
/usr/x86_64-pc-linux-gnu/bin/ld: skipping incompatible /usr/X11R6/lib/libXtst.awhen searching for -lXtst
/usr/x86_64-pc-linux-gnu/bin/ld: skipping incompatible /usr/lib/libXtst.so whensearching for -lXtst
/usr/x86_64-pc-linux-gnu/bin/ld: skipping incompatible /usr/lib/libXtst.a when searching for -lXtst
/usr/x86_64-pc-linux-gnu/bin/ld: cannot find -lXtst
collect2: ld returned 1 exit status

It seems that configure tries to find a 32 bit libXtst (which is part of app-emulation/emul-linux-x86-xlibs)

The attached solution would be to depend on emul-linux-x86-xlibs on amd64 multilib systems where USE="gcj" is set.
Comment 4 Panagiotis Christopoulos (RETIRED) gentoo-dev 2008-12-06 11:14:02 UTC
*** Bug 232315 has been marked as a duplicate of this bug. ***
Comment 5 Panagiotis Christopoulos (RETIRED) gentoo-dev 2008-12-06 11:14:40 UTC
*** Bug 245613 has been marked as a duplicate of this bug. ***
Comment 6 SpanKY gentoo-dev 2008-12-07 19:06:43 UTC
thanks, ive committed Chi-Thanh's patch

http://sources.gentoo.org/sys-devel/gcc/gcc-4.3.2.ebuild?r1=1.6&r2=1.7