Attached is a patch and a new ebuild to enable building of a 32-bit as well as a 64-bit libsandbox.so. This is needed when emerging a package that uses a 32-bit binary. An example of this is the current requirement of using a 32-bit implementation of java. This is one way of doing it, although, the developer may have a better idea.
Created attachment 20394 [details, diff] Patch for portage 2.0.49-r15. The latest non-masked. The patch here involves a new target to build a 32-bit libsandbox.so and a target to install it.
Comment on attachment 20394 [details, diff] Patch for portage 2.0.49-r15. The latest non-masked. Also, the path to libsandbox.so does not need to be fixed to /lib. Let the linker find it.
Created attachment 20395 [details] Ebuild to apply the patch and build and install the 32-bit lib.
Looks good, could use a diff instead of an entire ebuild replacement. This is probably the only way we're going to be able to allow java to coexist nicely on gentoo for amd64 until we get a native amd64 java 64bit port. Also, one other suggestion, I'd add the dep of emul-linux-x86-baselibs-1.0 and also, perhaps spit out a warning that gcc must have been compiled with multilib support if you're emerging portage with 'multilib'. Or perhaps even write a check routine that would auto-determine this. -Brad
Created attachment 20396 [details, diff] Diff from original r15 to my new r15 for you convenience.
Created attachment 20480 [details, diff] sandbox-amd64-fixes.patch I like this patch to sandbox better. It does some autodetection, and non to no changes to portage.ebuild at all.
Brad?
Created attachment 20620 [details, diff] sandbox-amd64-fixes-2.patch Ok, this fixes a small bug where the 32bit libs was not build ...
Created attachment 20621 [details, diff] this patch works
Created attachment 20625 [details, diff] sandbox-amd64-fixes-3.patch Ok, this should detect if gcc supports both -m32 and -m64. Some other fluff, sorry.
Created attachment 20646 [details, diff] sandbox-amd64-fixes-4.patch Ok, seems we cannot rely on auto detection. This removes it, and we can have a single call to make with: # make HAVE_64BIT_ARCH=1 all or to install: # make HAVE_64BIT_ARCH=1 install
Martin, Do you have a new ebuild for patch 4 or do I just apply it myself to the portage source tree?
Just apply yourself. If you want to add a patch against latest ebuild, feel free.
*** Bug 31507 has been marked as a duplicate of this bug. ***
I had a problem with the latest patch, augustus (Kris), can you verify if you have a problem with it, since you posted the original?? -Brad
Brad, can you elaborate ?
The patch doesn't apply to the standard tar.bz2 or the latest portage with -p0 or -p1. From looking at the patch it's a CVS diff. Can that be used on the normal tree with a flag or something?
Added an epatch line to the portage-2.0.49-r15 ebuild to patch src/sandbox-1.1 with sandbox-amd64-fixes-4.patch. It worked great for me.
*** Bug 34385 has been marked as a duplicate of this bug. ***
This sounds exciting, hope it can work. I might have done something wrong, but I can seem to get sun-jdk installed still. I manually patched all the required files, (Makefile, sandbox.c and sandbox_futils.c) and set HAVE_64BIT_ARCH to 1, ran through ebuild compile/install/qmerge, verified that it installed libsandbox.so and libsandbox32.so, then tried to emerge sun-jdk. This is what I get (which is different than before): Calculating dependencies ...done! >>> emerge (1 of 1) dev-java/sun-jdk-1.4.2.02 to / >>> md5 src_uri ;-) j2sdk-1_4_2_02-linux-i586.bin Could not open the sandbox library at 'libsandbox.so'.
Ill commit it to cvs - any objections ? If none, then Nick can add the portage side changes.
I need to test this again, when I first tested it it couldn't seem to find libsandbox properly, and the patch you made didn't correctly do the multilib detection. I'll do that today, and let you know. -Brad
I just tried this again, still get the same error. Maybe I'm doing something wrong with the patches.
Created attachment 22217 [details, diff] portage-2.0.49-r18_ebuild.patch Ok, just to make sure we are all on the same grounds, cp sandbox-amd64-fixes-4.patch to /usr/portage/sys-apps/portage/files, and then apply this patch to portage-2.0.49-r18.ebuild
And?
didn't work for me, still debugging it though
Created attachment 24576 [details, diff] working libsandbox 32/64 patch missed a spot in sandbox.c that did a sanity check which would cause the whole shebang to fail. Fixed.
Created attachment 24577 [details, diff] patch for portage-2.0.50_pre20 ebuild for convenience patch for ebuild
Azarah, please commit. I'd like to get this rolled into portage asap, as it needs to be part of 2004.0 ... I never meant to delay this much getting this fixed, got too busy with other crap.
azarah, Works good for Brad and I. I'd go for it as ~amd64.
Status?
Someone really needs to get on top of this before the AMD64team has to commit this ourselves. Important packages such as OpenOffice-bin depend on this for us.
The patch is fine... and I've included it for testing in portage-2.0.50-r2, but I really don't like how the ebuild looks. Figure out something cleaner or give me a good explanation of what needs to get done.
This is also in portage-2.0.50-r3 (50-r1 + sandbox security fixes).
Created attachment 31753 [details, diff] Patch against sys-apps/portage-2.0.50-r6 to allow using a 32bit libsandbox.so What about using this patch instead ? Works fine for me and doesn't include the sed thingie...
that patch manages to break portage for all amd64 users who dont have multilib... like myself. gcc libsandbox32.o sandbox_futils32.o -shared -m32 -fPIC -ldl -lc -nostdlib -lgcc -o libsandbox32.so /usr/lib/gcc/x86_64-pc-linux-gnu/3.4.0/../../../../x86_64-pc-linux-gnu/bin/ld: skipping incompatible /usr/lib/gcc/x86_64-pc-linux-gnu/3.4.0/../../../../lib/libdl.so when searching for -ldl /usr/lib/gcc/x86_64-pc-linux-gnu/3.4.0/../../../../x86_64-pc-linux-gnu/bin/ld: skipping incompatible /usr/lib/gcc/x86_64-pc-linux-gnu/3.4.0/../../../../lib/libdl.a when searching for -ldl /usr/lib/gcc/x86_64-pc-linux-gnu/3.4.0/../../../../x86_64-pc-linux-gnu/bin/ld: skipping incompatible /usr/lib/gcc/x86_64-pc-linux-gnu/3.4.0/../../../libdl.so when searching for -ldl /usr/lib/gcc/x86_64-pc-linux-gnu/3.4.0/../../../../x86_64-pc-linux-gnu/bin/ld: skipping incompatible /usr/lib/gcc/x86_64-pc-linux-gnu/3.4.0/../../../libdl.a when searching for -ldl /usr/lib/gcc/x86_64-pc-linux-gnu/3.4.0/../../../../x86_64-pc-linux-gnu/bin/ld: skipping incompatible /usr/lib/../lib/libdl.so when searching for -ldl /usr/lib/gcc/x86_64-pc-linux-gnu/3.4.0/../../../../x86_64-pc-linux-gnu/bin/ld: skipping incompatible /usr/lib/../lib/libdl.a when searching for -ldl /usr/lib/gcc/x86_64-pc-linux-gnu/3.4.0/../../../../x86_64-pc-linux-gnu/bin/ld: skipping incompatible /usr/lib/libdl.so when searching for -ldl /usr/lib/gcc/x86_64-pc-linux-gnu/3.4.0/../../../../x86_64-pc-linux-gnu/bin/ld: skipping incompatible /usr/lib/libdl.a when searching for -ldl /usr/lib/gcc/x86_64-pc-linux-gnu/3.4.0/../../../../x86_64-pc-linux-gnu/bin/ld: cannot find -ldl collect2: ld returned 1 exit status make: *** [libsandbox32.so] Error 1 !!! ERROR: sys-apps/portage-2.0.50-r6 failed. !!! Function src_install, Line 124, Exitcode 2 !!! Failed to compile sandbox
"use multilib" wasn't enough... I added a check_multilib() function that gets called instead and exports MULTILIB, which gets used by make/make install. I think this is fixed now - *finally*.
2.0.51_pre still broken
re-assigning to carpaski and marking as critical like he suggests
Created attachment 31881 [details, diff] fix for 2.0.51_pre7 ebuild
nevermind, i'll apply it myself.