Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 378711 - dev-libs/dietlibc-0.33 - allow to install in proper place when cross-compiling (PATCH added)
Summary: dev-libs/dietlibc-0.33 - allow to install in proper place when cross-compilin...
Status: RESOLVED NEEDINFO
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Current packages (show other bugs)
Hardware: All Linux
: Normal normal (vote)
Assignee: No maintainer - Look at https://wiki.gentoo.org/wiki/Project:Proxy_Maintainers if you want to take care of it
URL:
Whiteboard:
Keywords: NeedPatch
Depends on:
Blocks:
 
Reported: 2011-08-10 20:39 UTC by Bertrand Jacquin
Modified: 2018-05-28 17:42 UTC (History)
2 users (show)

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


Attachments
dietlibc-4e86d5e-BJA-strip-override.diff (dietlibc-0.33_pre20110403.ebuild-BJA-cross.diff,2.24 KB, patch)
2011-08-10 20:39 UTC, Bertrand Jacquin
Details | Diff
dietlibc-0.33_pre20110403.ebuild-BJA-cross.diff (dietlibc-0.33_pre20110403.ebuild-BJA-cross.diff,1.87 KB, patch)
2011-08-10 22:15 UTC, Bertrand Jacquin
Details | Diff
crossdev-BJA-dietlibc.diff (crossdev-BJA-dietlibc.diff,844 bytes, patch)
2011-08-10 22:36 UTC, Bertrand Jacquin
Details | Diff
dietlibc-0.33_pre20130103.ebuild-BJA-multiarch.diff (dietlibc-0.33_pre20130103.ebuild-BJA-multiarch.diff,2.09 KB, patch)
2013-06-10 16:39 UTC, Bertrand Jacquin
Details | Diff
files/dietlibc-0.33_pre20130103-BJA-nostrip.diff (dietlibc-0.33_pre20130103-BJA-nostrip.diff,3.19 KB, patch)
2013-06-10 16:40 UTC, Bertrand Jacquin
Details | Diff
dietlibc-0.33.ebuild (dietlibc-0.33.ebuild,2.17 KB, text/plain)
2013-11-22 22:42 UTC, Bertrand Jacquin
Details
files/0.33-BJA-nostrip.diff (0.33-BJA-nostrip.diff,3.19 KB, patch)
2013-11-22 22:43 UTC, Bertrand Jacquin
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Bertrand Jacquin 2011-08-10 20:39:33 UTC
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
Comment 1 Bertrand Jacquin 2011-08-10 20:39:53 UTC
Created attachment 282877 [details, diff]
dietlibc-4e86d5e-BJA-strip-override.diff
Comment 2 Bertrand Jacquin 2011-08-10 22:15:54 UTC
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
Comment 3 Bertrand Jacquin 2011-08-10 22:25:44 UTC
(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.
Comment 4 Bertrand Jacquin 2011-08-10 22:36:35 UTC
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
Comment 5 Pacho Ramos gentoo-dev 2013-01-03 20:15:43 UTC
+*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
Comment 6 Bertrand Jacquin 2013-06-10 16:39:51 UTC
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.
Comment 7 Bertrand Jacquin 2013-06-10 16:40:33 UTC
Created attachment 350660 [details, diff]
files/dietlibc-0.33_pre20130103-BJA-nostrip.diff

This replace sed from src_prepare() by a patch
Comment 8 Bertrand Jacquin 2013-06-10 16:45:34 UTC
Also available here: http://git.meleeweb.net/cgit.cgi/distros/gentoo/portage.git/log/dev-libs/dietlibc
Comment 9 Bertrand Jacquin 2013-11-22 22:42:38 UTC
Created attachment 363806 [details]
dietlibc-0.33.ebuild

Version bump
Comment 10 Bertrand Jacquin 2013-11-22 22:43:10 UTC
Created attachment 363808 [details, diff]
files/0.33-BJA-nostrip.diff

Replace sed with a proper patch
Comment 11 Pacho Ramos gentoo-dev 2018-02-06 08:06:19 UTC
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 :/)