<?xml version="1.0" encoding="UTF-8" standalone="yes" ?>
<!DOCTYPE bugzilla SYSTEM "http://bugs.gentoo.org/bugzilla.dtd">

<bugzilla version="2.22.7"
          urlbase="http://bugs.gentoo.org/"
          maintainer="bugzilla@gentoo.org"
>

    <bug>
          <bug_id>103775</bug_id>
          
          <creation_ts>2005-08-25 17:45 0000</creation_ts>
          <short_desc>snes9x fails to emerge on amd64</short_desc>
          <delta_ts>2005-12-26 08:31:56 0000</delta_ts>
          <reporter_accessible>1</reporter_accessible>
          <cclist_accessible>1</cclist_accessible>
          <classification_id>1</classification_id>
          <classification>Unclassified</classification>
          <product>Gentoo Linux</product>
          <component>Applications</component>
          <version>unspecified</version>
          <rep_platform>AMD64</rep_platform>
          <op_sys>Linux</op_sys>
          <bug_status>RESOLVED</bug_status>
          <resolution>FIXED</resolution>
          
          
          
          <priority>P2</priority>
          <bug_severity>normal</bug_severity>
          <target_milestone>---</target_milestone>
          
          
          
          <everconfirmed>1</everconfirmed>
          <reporter>jolt256@hotmail.com</reporter>
          <assigned_to>amd64@gentoo.org</assigned_to>
          <cc>games@gentoo.org</cc>
    
    <cc>gentoo@roboros.com</cc>

      

      
          <long_desc isprivate="0">
            <who>jolt256@hotmail.com</who>
            <bug_when>2005-08-25 17:45:34 0000</bug_when>
            <thetext>snes9x fails to emerge on amd64, using either X or opengl output, complaining of
incompatible libX11.so or libGLU.so

Reproducible: Always
Steps to Reproduce:
1. emerge snes9x
2. USE=&quot;-opengl&quot; emerge snes9x
3.

Actual Results:  
opengl build:
c++  -fno-rtti -INONE -I/var/tmp/portage/snes9x-1.43/work/snes9x-1.43-src/snes9x
-I/var/tmp/portage/snes9x-1.43/work/snes9x-1.43-src/snes9x/unzip  -o osnes9x
cpuops.o cpuexec.o sa1cpu.o spc700.o soundux.o apu.o  apudebug.o fxinst.o
fxemu.o fxdbg.o c4.o c4emu.o cpu.o sa1.o debug.o sdd1.o tile.o srtc.o gfx.o
memmap.o clip.o dsp1.o ppu.o dma.o snes9x.o data.o globals.o spc7110.o obc1.o
seta.o seta010.o seta011.o seta018.o 2xsai.o sdd1emu.o cheats.o cheats2.o
unix/unix.o unix/config.o snaporig.o snapshot.o screenshot.o movie.o netplay.o
server.o loadzip.o unzip/unzip.o unzip/explode.o unzip/unreduce.o
unzip/unshrink.o unix/x11.o unix/opengl.o  -lGL -lGLU -ldl  -lnsl   -m32  
-lpthread -lm
/usr/lib/gcc/x86_64-pc-linux-gnu/3.4.3/../../../../x86_64-pc-linux-gnu/bin/ld:
skipping incompatible /usr/lib/gcc/x86_64-pc-linux-gnu/3.4.3/../../../libGLU.so
when searching for -lGLU
/usr/lib/gcc/x86_64-pc-linux-gnu/3.4.3/../../../../x86_64-pc-linux-gnu/bin/ld:
skipping incompatible /usr/lib/gcc/x86_64-pc-linux-gnu/3.4.3/../../../libGLU.a
when searching for -lGLU
/usr/lib/gcc/x86_64-pc-linux-gnu/3.4.3/../../../../x86_64-pc-linux-gnu/bin/ld:
skipping incompatible /usr/lib/libGLU.so when searching for -lGLU
/usr/lib/gcc/x86_64-pc-linux-gnu/3.4.3/../../../../x86_64-pc-linux-gnu/bin/ld:
skipping incompatible /usr/lib/libGLU.a when searching for -lGLU
/usr/lib/gcc/x86_64-pc-linux-gnu/3.4.3/../../../../x86_64-pc-linux-gnu/bin/ld:
cannot find -lGLU
collect2: ld returned 1 exit status
make: *** [osnes9x] Error 1

x11 build:
c++  -fno-rtti -m32  -lX11 -lXext -lpthread 
-I/var/tmp/portage/snes9x-1.43/work/snes9x-1.43-src/snes9x
-I/var/tmp/portage/snes9x-1.43/work/snes9x-1.43-src/snes9x/unzip  -o offsets
offsets.cpp
/usr/lib/gcc/x86_64-pc-linux-gnu/3.4.3/../../../../x86_64-pc-linux-gnu/bin/ld:
skipping incompatible /usr/lib/gcc/x86_64-pc-linux-gnu/3.4.3/../../../libX11.so
when searching for -lX11
/usr/lib/gcc/x86_64-pc-linux-gnu/3.4.3/../../../../x86_64-pc-linux-gnu/bin/ld:
skipping incompatible /usr/lib/gcc/x86_64-pc-linux-gnu/3.4.3/../../../libX11.a
when searching for -lX11
/usr/lib/gcc/x86_64-pc-linux-gnu/3.4.3/../../../../x86_64-pc-linux-gnu/bin/ld:
skipping incompatible /usr/lib/libX11.so when searching for -lX11
/usr/lib/gcc/x86_64-pc-linux-gnu/3.4.3/../../../../x86_64-pc-linux-gnu/bin/ld:
skipping incompatible /usr/lib/libX11.a when searching for -lX11
/usr/lib/gcc/x86_64-pc-linux-gnu/3.4.3/../../../../x86_64-pc-linux-gnu/bin/ld:
cannot find -lX11
collect2: ld returned 1 exit status


Expected Results:  
emerged cleanly

Portage 2.0.51.22-r2 (default-linux/amd64/2005.1, gcc-3.4.3, glibc-2.3.5-r0,
2.6.12-gentoo-r6 x86_64)
=================================================================
System uname: 2.6.12-gentoo-r6 x86_64 AMD Hammer Family processor - Model Unknown
Gentoo Base System version 1.6.12
dev-lang/python:     2.3.5
sys-apps/sandbox:    1.2.11
sys-devel/autoconf:  2.13, 2.59-r6
sys-devel/automake:  1.4_p6, 1.5, 1.6.3, 1.7.9-r1, 1.8.5-r3, 1.9.5
sys-devel/binutils:  2.15.92.0.2-r10
sys-devel/libtool:   1.5.18-r1
virtual/os-headers:  2.6.11-r2
ACCEPT_KEYWORDS=&quot;amd64&quot;
AUTOCLEAN=&quot;yes&quot;
CBUILD=&quot;x86_64-pc-linux-gnu&quot;
CFLAGS=&quot;-O2 -march=k8 -pipe -fomit-frame-pointer&quot;
CHOST=&quot;x86_64-pc-linux-gnu&quot;
CONFIG_PROTECT=&quot;/etc /usr/kde/2/share/config /usr/kde/3/share/config
/usr/lib/X11/xkb /usr/share/config /var/qmail/control&quot;
CONFIG_PROTECT_MASK=&quot;/etc/gconf /etc/terminfo /etc/env.d&quot;
CXXFLAGS=&quot;-O2 -march=k8 -pipe -fomit-frame-pointer&quot;
DISTDIR=&quot;/usr/portage/distfiles&quot;
FEATURES=&quot;autoconfig distlocks sandbox sfperms strict&quot;
GENTOO_MIRRORS=&quot;http://distfiles.gentoo.org
http://distro.ibiblio.org/pub/Linux/distributions/gentoo&quot;
MAKEOPTS=&quot;-j2&quot;
PKGDIR=&quot;/usr/portage/packages&quot;
PORTAGE_TMPDIR=&quot;/var/tmp&quot;
PORTDIR=&quot;/usr/portage&quot;
SYNC=&quot;rsync://rsync.gentoo.org/gentoo-portage&quot;
USE=&quot;amd64 X alsa avi berkdb bitmap-fonts crypt cups dvd eds encode esd fam fftw
flac foomaticdb fortran gif gnome gpm gstreamer gtk gtk2 imlib ipv6 joystick
jpeg kde lirc lzw lzw-tiff mad matroska mp3 mpeg mysql ncurses net nvidia ogg
oggvorbis opengl pam pdflib perl png python qt quicktime readline sdl spell ssl
tcpd theora tiff transcode truetype truetype-fonts type1-fonts usb userlocales
vorbis xinerama xml2 xmms xpm xv xvid zlib userland_GNU kernel_linux elibc_glibc&quot;
Unset:  ASFLAGS, CTARGET, LANG, LC_ALL, LDFLAGS, LINGUAS, PORTDIR_OVERLAY</thetext>
          </long_desc>
          <long_desc isprivate="0">
            <who>vapier@gentoo.org</who>
            <bug_when>2005-08-26 06:27:04 0000</bug_when>
            <thetext>do you have the xlib emul packages emerged ?</thetext>
          </long_desc>
          <long_desc isprivate="0">
            <who>vapier@gentoo.org</who>
            <bug_when>2005-08-26 21:25:59 0000</bug_when>
            <thetext>fixed in cvs, added emul libs to DEPEND for amd64</thetext>
          </long_desc>
          <long_desc isprivate="0">
            <who>Storklerk@ariolc.dyndns.org</who>
            <bug_when>2005-08-27 11:56:56 0000</bug_when>
            <thetext>I still get the same error with snes9x-1.43-r1 both building the opengl or the
X11 version, but I have emul-linux-x86-xlibs-2.1 installed.

emerge --info:
Portage 2.0.51.22-r2 (default-linux/amd64/2005.1, gcc-3.4.4, glibc-2.3.5-r1,
2.6.12-mm2 x86_64)
=================================================================
System uname: 2.6.12-mm2 x86_64 AMD Athlon(tm) 64 Processor 3200+
Gentoo Base System version 1.6.13
dev-lang/python:     2.3.5
sys-apps/sandbox:    1.2.12
sys-devel/autoconf:  2.13, 2.59-r7
sys-devel/automake:  1.4_p6, 1.5, 1.6.3, 1.7.9-r1, 1.8.5-r3, 1.9.6
sys-devel/binutils:  2.15.92.0.2-r10
sys-devel/libtool:   1.5.18-r1
virtual/os-headers:  2.6.11-r2
ACCEPT_KEYWORDS=&quot;amd64&quot;
AUTOCLEAN=&quot;yes&quot;
CBUILD=&quot;x86_64-pc-linux-gnu&quot;
CFLAGS=&quot;-O3 -pipe -fomit-frame-pointer -march=athlon64&quot;
CHOST=&quot;x86_64-pc-linux-gnu&quot;
CONFIG_PROTECT=&quot;/etc /usr/kde/2/share/config /usr/kde/3.4/env
/usr/kde/3.4/share/config /usr/kde/3.4/shutdown /usr/kde/3/share/config
/usr/lib/X11/xkb /usr/lib64/mozilla/defaults/pref /usr/share/config
/usr/share/texmf/dvipdfm/config/ /usr/share/texmf/dvips/config/
/usr/share/texmf/tex/generic/config/ /usr/share/texmf/tex/platex/config/
/usr/share/texmf/xdvi/ /var/qmail/control&quot;
CONFIG_PROTECT_MASK=&quot;/etc/gconf /etc/terminfo /etc/env.d&quot;
CXXFLAGS=&quot;-O3 -pipe -fomit-frame-pointer -march=athlon64&quot;
DISTDIR=&quot;/usr/portage/distfiles&quot;
FEATURES=&quot;autoconfig buildpkg distlocks fixpackages sandbox sfperms strict&quot;
GENTOO_MIRRORS=&quot;[removed]&quot;
MAKEOPTS=&quot;-j2&quot;
PKGDIR=&quot;/var/portage/packages&quot;
PORTAGE_TMPDIR=&quot;/var/tmp&quot;
PORTDIR=&quot;/usr/portage&quot;
PORTDIR_OVERLAY=&quot;/root/ebuilds&quot;
SYNC=&quot;rsync://rsync.gentoo.org/gentoo-portage&quot;
USE=&quot;amd64 X a52 aac acl acpi alsa apache2 arts avi berkdb bitmap-fonts cdr
cross crypt cups curl customlog doc dts dvb dvd dvdr dvdread eds emacs encode
esd ethereal fam ffmpeg flac font-server foomaticdb fortran gcj gd gdbm gif
gnutls gpm gstreamer gtk gtk2 ieee1394 imagemagick imlib ipv6 ithreads java jpeg
junit kde libwww lzo lzw lzw-tiff mad matroska mbox mikmod motif mozcalendar
mozdevelop mozilla mozsvg mozxmlterm mp3 mpeg mysql ncurses nls nptl ogg
oggvorbis opengl pam pda pdflib perl png python qt quicktime readline ruby samba
scanner sdl session slang spell ssl tcltk tcpd tetex theora tiff truetype
truetype-fonts type1-fonts usb userlocales v4l v4l2 vcd vorbis xine xinerama xml
xml2 xmms xpm xv xvid zlib video_cards_radeon userland_GNU kernel_linux elibc_glibc&quot;
Unset:  ASFLAGS, CTARGET, LANG, LC_ALL, LDFLAGS, LINGUAS

genlop -eu emul-linux-x86-xlibs:
 * app-emulation/emul-linux-x86-xlibs

[snip]
     Fri Mar 11 14:03:17 2005 &gt;&gt;&gt; app-emulation/emul-linux-x86-xlibs-1.2-r7
     Mon May 23 20:11:13 2005 &lt;&lt;&lt; app-emulation/emul-linux-x86-xlibs-1.2-r7
     Mon May 23 20:11:14 2005 &gt;&gt;&gt; app-emulation/emul-linux-x86-xlibs-2.1

locate libGLU.so:
/usr/lib/libGLU.so.1.3
/usr/lib/libGLU.so.1
/usr/lib/libGLU.so
/emul/linux/x86/usr/lib/libGLU.so.1.3
/emul/linux/x86/usr/lib/libGLU.so
/emul/linux/x86/usr/lib/libGLU.so.1


I did a quick look into the configure of snes9x, it seems not to look for any of
the opengl libs, just setting a flag.
The Makefile then adds &quot;-lGL -lGLU -ldl&quot; without checking, assuming the libs are
at there default location.
But on amd64 this will only find the x86_64 versions which will fail to link
againts something build with -m32 </thetext>
          </long_desc>
          <long_desc isprivate="0">
            <who>jesterr@gmail.com</who>
            <bug_when>2005-09-15 01:28:26 0000</bug_when>
            <thetext>Same here, I suggest to reopen the bug</thetext>
          </long_desc>
          <long_desc isprivate="0">
            <who>wolf31o2@gentoo.org</who>
            <bug_when>2005-09-15 06:28:47 0000</bug_when>
            <thetext>Alright... Anyone have a patch, then?</thetext>
          </long_desc>
          <long_desc isprivate="0">
            <who>Storklerk@ariolc.dyndns.org</who>
            <bug_when>2005-09-15 11:56:10 0000</bug_when>
            <thetext>Using the secret trick from bug #104049 I was able to build a 64bit native
snes9x-1.43-r1.

osnes9x still crashes on startup, but with the normal snes9x executable I was
able to get to the startup screen of a game. Then it seems to hang, but is
better than the instant segfaults from the earlier ebuilds. Maybe the rom file
is damaged, but I dont have more time to test this.

So, if you want to build on amd64 you need to set this variable.

As the 32bit build does not work/build at all, should this be done automaticly?</thetext>
          </long_desc>
          <long_desc isprivate="0">
            <who>gentoo@roboros.com</who>
            <bug_when>2005-11-05 03:17:08 0000</bug_when>
            <thetext>I was able to make it build a 32-bit version on amd64 with some small changes to
the ebuild. I&apos;m pretty sure there&apos;s a better way to do it, but at least it
works. I&apos;ll attach a patch.

Note that although it built OK the OpenGL version (osnesx9x) didn&apos;t work on the
single game I tried it with. The plain X version (snes9x) seems to work OK so far.

</thetext>
          </long_desc>
          <long_desc isprivate="0">
            <who>gentoo@roboros.com</who>
            <bug_when>2005-11-05 03:18:37 0000</bug_when>
            <thetext>Created an attachment (id=72163)
patch for amd64 build problems
</thetext>
          </long_desc>
          <long_desc isprivate="0">
            <who>vapier@gentoo.org</who>
            <bug_when>2005-11-05 13:06:35 0000</bug_when>
            <thetext>(From update of attachment 72163)
yeah, that&apos;s def not correct
</thetext>
          </long_desc>
          <long_desc isprivate="0">
            <who>gentoo@roboros.com</who>
            <bug_when>2005-11-06 06:31:11 0000</bug_when>
            <thetext>So, how do you teach gcc to look for libs in the correct place when compiling
with -m32?

$ gcc -print-file-name=libz.so
/usr/lib/gcc/x86_64-pc-linux-gnu/3.4.4/../../../../lib64/libz.so
$ gcc -m32 -print-file-name=libz.so
/usr/lib/gcc/x86_64-pc-linux-gnu/3.4.4/../../../libz.so
$ gcc -print-file-name=libGLU.so
/usr/lib/gcc/x86_64-pc-linux-gnu/3.4.4/../../../../lib64/libGLU.so
$ gcc -m32 -print-file-name=libGLU.so
/usr/lib/gcc/x86_64-pc-linux-gnu/3.4.4/../../../libGLU.so

But /usr/lib64 is just a symlink to /usr/lib so libz.so and libGLU.so above are
64-bit libs AFAICS. libc.a on the other hand:

$ gcc -print-file-name=libc.a
/usr/lib/gcc/x86_64-pc-linux-gnu/3.4.4/../../../../lib64/libc.a
$ gcc -m32 -print-file-name=libc.a
/usr/lib/gcc/x86_64-pc-linux-gnu/3.4.4/../../../../lib32/libc.a
</thetext>
          </long_desc>
          <long_desc isprivate="0">
            <who>blubb@gentoo.org</who>
            <bug_when>2005-12-26 08:31:56 0000</bug_when>
            <thetext>adding

pkg_setup() {
 has_multilib_profile &amp;&amp; ABI=x86
}

was the way to go. sorry for the huge delay</thetext>
          </long_desc>
      
          <attachment
              isobsolete="1"
              ispatch="1"
              isprivate="0"
          >
            <attachid>72163</attachid>
            <date>2005-11-05 03:18 0000</date>
            <desc>patch for amd64 build problems</desc>
            <filename>snes.patch</filename>
            <type>text/plain</type>
            <data encoding="base64">LS0tIHNuZXM5eC0xLjQzLXIxLmVidWlsZC5vcmlnCTIwMDUtMDgtMjggMjM6MzU6MzkuMDAwMDAw
MDAwICswMjAwCisrKyBzbmVzOXgtMS40My1yMS5lYnVpbGQJMjAwNS0xMS0wNSAxMTo1MDowMC4w
MDAwMDAwMDAgKzAxMDAKQEAgLTQ3LDcgKzQ3LDcgQEAKIAlpZiB1c2UgYW1kNjQgJiYgW1sgLXog
JHtOQVRJVkVfQU1ENjRfQlVJTERfUExafSBdXSA7IHRoZW4KIAkJZXhwb3J0IEFCST14ODYKIAkJ
YXBwZW5kLWZsYWdzIC1tMzIKLQkJYXBwZW5kLWxkZmxhZ3MgLW0zMgorCQlhcHBlbmQtbGRmbGFn
cyAtbTMyIC1ML2VtdWwvbGludXgveDg2L2xpYjMyIC1ML2VtdWwvbGludXgveDg2L3Vzci9saWIz
MgogCWZpCiAKIAlsb2NhbCB2aWRjb25mPQpAQCAtNjksNiArNjksMTAgQEAKIAkJCQl0YXJnZXQ9
b3NuZXM5eDs7CiAJCQlmYWxsYmFja3xYKQogCQkJCXZpZGNvbmY9Ii0td2l0aC14IC0td2l0aG91
dC1nbGlkZSAtLXdpdGhvdXQtb3BlbmdsIgorCQkJCWlmIHVzZSBhbWQ2NCAmJiBbWyAteiAke05B
VElWRV9BTUQ2NF9CVUlMRF9QTFp9IF1dIDsgdGhlbgorCQkJCQkjIHdpdGhvdXQgdGhpcyAvdXNy
L2xpYjY0IGdldHMgYWRkZWQKKwkJCQkJdXNlIGFtZDY0ICYmIHZpZGNvbmY9IiR2aWRjb25mIC0t
eC1saWJyYXJpZXM9L2VtdWwvbGludXgveDg2L3Vzci9saWIzMiIKKwkJCQlmaQogCQkJCXRhcmdl
dD1zbmVzOXg7OwogCQllc2FjCiAJCSMgdGhpcyBzdHVmZiBpcyB1Z2x5IGJ1dCBoZXkgdGhlIGJ1
aWxkIHByb2Nlc3Mgc3Vja3MgOykK
</data>        

          </attachment>
    </bug>

</bugzilla>