Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!

Bug 430702 (musl-porting)

Summary: [TRACKER] sys-libs/musl porting
Product: Gentoo Linux Reporter: Anthony Basile <blueness>
Component: Current packagesAssignee: Gentoo musl team <musl>
Status: CONFIRMED ---    
Severity: normal CC: arkamar, bertrand, bugzie, dev-embedded+disabled, developer, embedded, erikdenstore+gbugs, felix.janda, fredric.miscmail, gentoo, gentoo, gentoo, gentoo, hadrien.lacour, izarf.mail, lssndrbarbieri, nikoli, tdalman, toast+misc, tsmksubc
Priority: Normal Keywords: Tracker
Version: unspecified   
Hardware: All   
OS: Linux   
URL: http://www.etalabs.net/musl/
Whiteboard:
Package list:
Runtime testing required: ---
Bug Depends on: 546692, 550228, 552616, 589094, 590094, 712462, 712652, 713624, 714106, 715578, 716296, 738450, 782565, 792567, 828141, 828709, 828813, 828843, 828906, 829174, 829176, 829188, 829236, 829239, 829240, 829248, 829249, 829294, 830245, 832422, 834276, 834326, 839972, 863077, 864449, 868732, 876520, 879193, 880061, 892079, 894260, 894330, 894596, 910426, 921110, 924648, 928734, 430838, 431686, 448590, 448592, 473328, 477290, 498114, 498394, 503914, 504142, 504200, 525136, 527788, 529348, 529350, 529354, 529384, 530080, 531168, 531368, 531846, 532514, 533570, 533660, 535974, 536834, 538306, 538474, 538482, 538956, 539210, 540032, 541508, 541694, 541728, 542026, 542030, 542484, 542780, 543826, 543834, 543836, 543838, 544022, 544032, 544062, 544128, 544306, 544476, 545006, 545502, 546272, 546556, 546890, 547368, 548422, 548474, 548886, 549100, 549108, 549116, 549506, 549942, 549966, 549976, 550204, 550298, 550300, 550842, 551606, 551610, 551612, 551614, 551616, 551620, 551622, 551624, 551626, 551628, 551630, 551640, 551818, 552708, 553936, 554032, 554416, 557042, 559516, 559518, 559520, 559688, 559784, 559788, 559818, 560228, 560728, 560826, 560860, 561672, 563732, 564586, 565978, 566752, 567506, 567674, 567678, 570474, 570522, 570524, 570838, 570936, 571036, 571220, 571230, 571374, 571444, 573170, 574160, 574356, 574366, 574610, 574654, 574830, 575098, 575394, 575614, 575984, 577098, 577658, 578424, 579104, 580242, 580362, 580686, 581010, 581470, 581660, 582824, 583266, 584352, 584416, 585560, 585576, 585698, 586002, 586432, 588186, 588248, 588270, 589666, 590098, 590738, 590994, 591982, 592268, 593030, 595950, 597076, 597646, 600860, 600934, 602092, 602102, 602104, 602106, 602108, 602114, 602116, 602118, 602120, 602124, 602126, 602714, 603626, 603648, 604212, 604260, 604590, 604594, 606126, 607562, 607618, 608172, 609296, 609306, 609364, 609382, 609488, 610936, 615534, 615736, 622588, 624316, 624320, 644518, 646188, 648008, 660648, 665164, 676528, 687008, 687234, 687236, 688396, 693324, 703210, 703212, 706792, 708426, 712624, 712626, 713316, 713378, 713386, 713422, 713470, 713618, 714652, 715758, 715910, 716126, 716564, 716806, 719512, 737474, 739474, 747346, 747934, 761352, 762442, 762484, 762997, 763000, 763996, 764113, 766833, 766866, 768027, 768069, 768078, 768099, 777375, 779109, 792555, 799266, 799281, 807763, 818700, 818757, 819543, 819549, 825458, 828671, 828677, 828687, 828696, 828704, 828726, 828772, 828773, 828809, 828830, 828859, 828871, 828894, 828901, 828917, 828918, 828919, 829147, 829150, 829151, 829152, 829154, 829242, 829245, 829246, 829247, 829285, 829325, 829328, 829345, 829574, 829580, 829581, 829599, 829607, 829608, 829618, 829690, 830108, 830471, 830558, 830930, 830945, 832259, 832260, 832549, 832573, 832700, 832980, 833033, 833753, 834341, 834347, 835017, 836577, 836705, 836872, 837275, 838466, 838469, 848420, 853118, 853763, 862462, 862645, 862888, 863554, 863962, 867343, 869128, 870001, 870187, 870577, 872263, 879321, 884027, 888467, 890553, 890555, 890953, 892868, 892870, 896374, 903749, 906605, 907177, 915835, 923004, 923233, 923257, 923647, 925169, 925195    
Bug Blocks: 577280    
Attachments: initial musl ebuild

Description Anthony Basile gentoo-dev 2012-08-10 01:31:23 UTC
musl is a new standard library which aims to be small, fast, and conform to standards.  It should be of interest to embedded systems development as an alternative to other small libc's like uclibc.  It is currently undergoing heavy development.

This bug will track issues to including musl the gentoo maintree.

Reproducible: Always
Comment 1 Luca Barbato gentoo-dev 2012-08-16 19:51:09 UTC
Created attachment 321498 [details]
initial musl ebuild

Here the initial ebuild for musl

there are problems in installing it either on /usr or /usr/${chost} (gcc and binutils consider musl a bare-metal libc and expect everything to reside in /usr/${chost} instead of /usr/${chost}/usr/
Comment 2 SpanKY gentoo-dev 2012-08-16 21:01:11 UTC
we work around that by creating a usr->. symlink in /usr/${CTARGET}/
Comment 3 Anthony Basile gentoo-dev 2012-08-16 21:49:07 UTC
(In reply to comment #1)
> Created attachment 321498 [details]
> initial musl ebuild
> 
> Here the initial ebuild for musl
> 
> there are problems in installing it either on /usr or /usr/${chost} (gcc and
> binutils consider musl a bare-metal libc and expect everything to reside in
> /usr/${chost} instead of /usr/${chost}/usr/

Luca, take a look at the ebuild I posted on the dep bug #430838, comment #1.  musl does allow you to install it on a glibc system as an alternative standard library which can be used as via musl-gcc, a wrapper which calls gcc with a spec file pointing to the musl install location.  I'd like to keep that since I use musl that way.  So mine has

	if [ ${CTARGET} == ${CHOST} ] ; then
		case ${CHOST} in
			*-musl*) do_native_config ;;
			*) do_alternative_config ;;
		esac

while yours has

	if [[ ${CTARGET} == ${CHOST} ]] ; then
		case ${CHOST} in
			*-musl) ;;
			*) die "Use sys-devel/crossdev to build a musl toolchain"
		esac
Comment 4 Luca Barbato gentoo-dev 2012-12-25 17:42:14 UTC
You are right, I'll update the new mine with your change to allow side-install.
Comment 5 Anthony Basile gentoo-dev 2012-12-25 20:39:23 UTC
(In reply to comment #4)
> You are right, I'll update the new mine with your change to allow
> side-install.

Why did you decide against the side by side?
Comment 6 Tim Harder gentoo-dev 2013-12-12 20:13:47 UTC
*** Bug 493876 has been marked as a duplicate of this bug. ***
Comment 7 Anthony Basile gentoo-dev 2015-06-12 19:34:35 UTC
Note to everyone.   The musl overlay has been moved from the musl branch of the hardened-dev overlay to its own overlay at:

    https://gitweb.gentoo.org/proj/musl.git/

I will be removing all the ebuilds from the hardened-dev::musl in a few days and place a deprecation notice in place.  The history in that branch, however, will remain forever.

Also note, I did not migrate the history to the new overlay but started fresh.  There was way too much cruft in the hardened-dev::musl branch since it pulled in all the history from the uclibc and master branch going all the way back to 2008.  The disadvantage is that for patch authorship you have to go back to the old hardened-dev::musl but I will make sure to do so to properly assign credit if I pass any patches upstream.