dietlibc-0.33_pre20110403 can't be used in a crossdev env as everything is installed in /usr/{bin,diet} So if my host is x86_64-pc-linux-gnu and trying to compile something to i586-unknown-linux-gnu with diet as gcc wrapper, here is the result : i586-alix-linux-dietlibc-gcc -Wl,--gc-sections -Os -pipe -march=geode -mmmx -m3dnow -fomit-frame-pointer -I/usr/i586-alix-linux-dietlibc/usr/include/ -I/usr/i586-alix-linux-dietlibc/include/ -static -D_GNU_SOURCE -fomit-frame-pointer -mno-omit-leaf-frame-pointer -Wl,--gc-sections -o mkdev mkdev.c i586-alix-linux-gnu-gcc: i586-alix-linux-gnu-gcc: /usr/diet/lib-i386/start.o: No such file or directory /usr/diet/lib-i386/start.o: No such file or directory i586-alix-linux-gnu-gcc: /usr/diet/lib-i386/libc.a: No such file or directory i586-alix-linux-gnu-gcc: /usr/diet/lib-i386/libc.a: No such file or directory This is cause as dietlibc as always builded for CBUILD as MYARCH is not setted : hollow-dietlibc-4e86d5e/Makefile MYARCH:=$(shell uname -m | sed -e 's/i[4-9]86/i386/' -e 's/armv[3-6]t\?e\?[lb]/arm/') And my case I only have /usr/diet/lib-x86_64/ I can change this value manually, but I can only have one dietlibc instance on my building host which is not ideal. Here is a fix to do things like done in uclibc and glibc and create for example i586-alix-linux-diet This may need some tweaks. We should also define some USEs to indicate the destination ARCH to install and so only multiple ARCH installed in /usr/diet ? Reproducible: Always
Created attachment 282877 [details, diff] dietlibc-4e86d5e-BJA-strip-override.diff
Created attachment 282885 [details, diff] dietlibc-0.33_pre20110403.ebuild-BJA-cross.diff Here is a much better solution imho, just define target_XXX that you need, you need to set appropriate CROSS_XXX to compile correctly target libc arch
(In reply to comment #2) > Created attachment 282885 [details, diff] > dietlibc-0.33_pre20110403.ebuild-BJA-cross.diff > > Here is a much better solution imho, just define target_XXX that you need, you > need to set appropriate CROSS_XXX to compile correctly target libc arch Also, CFLAGS should be setted by target or only generic ones.
Created attachment 282887 [details, diff] crossdev-BJA-dietlibc.diff As you can't really hope to build a gcc/gdb/etc with dielibc here is a patch to crossdev to only permit build a binutils
+*dietlibc-0.33_pre20130103 (03 Jan 2013) + + 03 Jan 2013; Pacho Ramos <pacho@gentoo.org> +dietlibc-0.33_pre20130103.ebuild: + Bump with snapshot taken today to get all the changes upstream did + Would be nice to get an updated patch against latest ebuild. Thanks
Created attachment 350658 [details, diff] dietlibc-0.33_pre20130103.ebuild-BJA-multiarch.diff Here is an updated patch for the ebuild to be able to build for multiple arch as request by @pacho. I also use a patch for Makefile to remove strip as sed in ebuild in not fully correct. This also introduce a diet_flags funcs that is called for each targe as PIE (in the current case) can be available for the CBUILD and not for CHOST.
Created attachment 350660 [details, diff] files/dietlibc-0.33_pre20130103-BJA-nostrip.diff This replace sed from src_prepare() by a patch
Also available here: http://git.meleeweb.net/cgit.cgi/distros/gentoo/portage.git/log/dev-libs/dietlibc
Created attachment 363806 [details] dietlibc-0.33.ebuild Version bump
Created attachment 363808 [details, diff] files/0.33-BJA-nostrip.diff Replace sed with a proper patch
We would need an updated patch against current version (or, even better, someone volunteering to proxy maintain this to get the fixes faster in the tree... as it seems latest version in the tree is also suffering many other issues :/)