Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 417451 - toolchain-funcs.eclass:gen_usr_ldscript - make no-op on non-bootable systems
Summary: toolchain-funcs.eclass:gen_usr_ldscript - make no-op on non-bootable systems
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Current packages (show other bugs)
Hardware: All Linux
: Normal normal
Assignee: Gentoo Toolchain Maintainers
URL:
Whiteboard:
Keywords:
: 420087 426416 (view as bug list)
Depends on:
Blocks: 428014
  Show dependency tree
 
Reported: 2012-05-25 07:27 UTC by Yuriy Rusinov
Modified: 2022-03-27 00:11 UTC (History)
9 users (show)

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


Attachments
i686-mingw32-emerge --info (file_417451.txt,3.16 KB, text/plain)
2012-05-25 07:27 UTC, Yuriy Rusinov
Details
Full build log (build.log,97.85 KB, text/plain)
2012-05-25 19:23 UTC, Yuriy Rusinov
Details
patch for toolchain-funcs.eclass (428014.eclass.patch,578 bytes, patch)
2012-07-25 12:38 UTC, Yuta SATOH
Details | Diff
new patch for toolchain-funcs.eclass (428014.eclass_new.patch,657 bytes, patch)
2012-07-25 13:40 UTC, Yuta SATOH
Details | Diff
disable-gen-ldscript.patch (disable-gen-ldscript.patch,615 bytes, patch)
2013-09-27 19:04 UTC, William Hubbs
Details | Diff
gen_usr_ldscript.patch (gen_usr_ldscript.patch,1.63 KB, patch)
2015-01-20 17:25 UTC, William Hubbs
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Yuriy Rusinov 2012-05-25 07:27:06 UTC
Created attachment 313025 [details]
i686-mingw32-emerge --info

sudo ACCEPT_KEYWORDS=** i686-mingw32-emerge -av dev-libs/libiconv failed on install phase
last log before errors is

/usr/bin/install -c -m 644 ./iconv_open.3.html /usr/i686-mingw32/tmp/portage/dev-libs/libiconv-1.14/image//usr/share/doc/libiconv-1.14/html/iconv_open.3.html
/usr/bin/install -c -m 644 ./iconv_open_into.3.html /usr/i686-mingw32/tmp/portage/dev-libs/libiconv-1.14/image//usr/share/doc/libiconv-1.14/html/iconv_open_into.3.html
make[1]: Leaving directory `/usr/i686-mingw32/tmp/portage/dev-libs/libiconv-1.14/work/libiconv-1.14/man'
 * ERROR: dev-libs/libiconv-1.14 failed (install phase):
 *   unable to read SONAME from libiconv.dll
 * 
 * Call stack:
 *     ebuild.sh, line   85:  Called src_install
 *   environment, line 1036:  Called gen_usr_ldscript '-a' 'iconv' 'charset'
 *   environment, line  692:  Called die
 * The specific snippet of code:
 *                       [[ -z ${tlib} ]] && die "unable to read SONAME from ${lib}";
 * 
 * If you need support, post the output of 'emerge --info =dev-libs/libiconv-1.14',
 * the complete build log and the output of 'emerge -pqv =dev-libs/libiconv-1.14'.
 * The complete build log is located at '/usr/i686-mingw32/tmp/portage/dev-libs/libiconv-1.14/temp/build.log'.
 * The ebuild environment file is located at '/usr/i686-mingw32/tmp/portage/dev-libs/libiconv-1.14/temp/environment'.
 * S: '/usr/i686-mingw32/tmp/portage/dev-libs/libiconv-1.14/work/libiconv-1.14'

>>> Failed to emerge dev-libs/libiconv-1.14 for /usr/i686-mingw32/, Log file:

>>>  '/usr/i686-mingw32/tmp/portage/dev-libs/libiconv-1.14/temp/build.log'
Comment 1 Jeroen Roovers (RETIRED) gentoo-dev 2012-05-25 16:39:40 UTC
Please attach the entire build log to this bug report.
Comment 2 Yuriy Rusinov 2012-05-25 19:23:43 UTC
Created attachment 313057 [details]
Full build log
Comment 3 Naohiro Aota gentoo-dev 2012-05-29 09:09:53 UTC
Could you post the following command result?

scanelf -qF'%S#F' /usr/i686-pc-mingw32/tmp/portage/dev-libs/libiconv-1.14/images/usr/lib/libiconv.dll 

(libiconv.dll path may be different)
Comment 4 Yuriy Rusinov 2012-05-29 09:36:22 UTC
scanelf -qF'%S#F' /usr/i686-pc-mingw32/tmp/portage/dev-libs/libiconv-1.14/image/usr/lib/libiconv.dll.a

gives nothing.

rusinov@localhost ~ $ scanelf -qF'%S#F' /usr/i686-pc-mingw32/tmp/portage/dev-libs/libiconv-1.14/image/usr/lib/libiconv.dll.a 
rusinov@localhost ~ $
Comment 5 Naohiro Aota gentoo-dev 2012-05-29 10:14:19 UTC
(In reply to comment #4)
> scanelf -qF'%S#F'
> /usr/i686-pc-mingw32/tmp/portage/dev-libs/libiconv-1.14/image/usr/lib/
> libiconv.dll.a
> 
> gives nothing.
> 
> rusinov@localhost ~ $ scanelf -qF'%S#F'
> /usr/i686-pc-mingw32/tmp/portage/dev-libs/libiconv-1.14/image/usr/lib/
> libiconv.dll.a 
> rusinov@localhost ~ $

ah "-q" may suppressed error. how about scanelf -vvF'%S#F' ?
Comment 6 Yuriy Rusinov 2012-05-29 10:47:31 UTC
Nothing too.
Comment 7 Naohiro Aota gentoo-dev 2012-05-29 22:01:54 UTC
@toolchain
This is CHOST="i686-mingw32" issue. Dose this has a way to retrieve SONAME? If not, this platform also listed to gen_usr_ldscript's case matching?
Comment 8 Yuriy Rusinov 2012-05-30 04:27:03 UTC
I'm afraid no, which way I have to verify it ?
Comment 9 SpanKY gentoo-dev 2012-05-30 15:45:20 UTC
i'm thinking we should just disable this code for all targets where Gentoo isn't the native booting OS

i.e. for non-linux and non-bsd systems, have the function do nothing at all

this will allow us to gut quite a bit of code (mach-o and such), but it might mean we have to fix an assumption or two in the ebuilds that use this function.  i think that's a small price to pay though to tweak the API of the func.
Comment 10 Fabian Groffen gentoo-dev 2012-05-30 15:50:17 UTC
(In reply to comment #9)
> i'm thinking we should just disable this code for all targets where Gentoo
> isn't the native booting OS
> 
> i.e. for non-linux and non-bsd systems, have the function do nothing at all
> 
> this will allow us to gut quite a bit of code (mach-o and such), but it
> might mean we have to fix an assumption or two in the ebuilds that use this
> function.  i think that's a small price to pay though to tweak the API of
> the func.

Yes, but I'm not looking forward to it, since it will break each and every OSX system badly, and IIRC also on ELF systems this caused some problems.

At least on OSX, a zlib upgrade will destroy the entire Prefix offset, unless Portage's preserve-libs catches this problem these days.  If so, there is hope, otherwise, I'd prefer not to bother.
Comment 11 Michael Haubenwallner (RETIRED) gentoo-dev 2012-05-30 17:39:46 UTC
Rendering the ebuild assumptions to be valid for one platform and invalid for another doesn't feel like an improvement at all, just more $CHOST cases...
Comment 12 SpanKY gentoo-dev 2012-05-30 18:16:22 UTC
(In reply to comment #10)

i don't follow.  why would this cause a problem ?  the point of `gen_usr_ldscript -a` is to move the shared lib from /usr/lib to /lib and drop a linker script in /usr/lib.  if, instead, that did nothing at all, you'd have the shared library in /usr/lib and no linker script.  the shared library isn't being deleted anywhere.

(In reply to comment #11)

the point is to adjust the API so you can't assume anything at all.  you run `gen_usr_ldscript -a` at the end of the install steps and do not attempt to touch the shared library in /lib or /usr/lib.  this is how i've always used it.
Comment 13 Fabian Groffen gentoo-dev 2012-05-30 18:24:45 UTC
Mach-O uses absolute references to the shared libs (libxxx.dylib).  I broke all systems when I introduced gen_usr_ldscript for OSX.  On the first zlib upgrade the breakage became visible, because everything, including gcc was referring to usr/lib/libz.dylib -- which after the update resided in lib/libz.dylib.  A kernel trap was all that one could get.  Making gen_usr_ldscript a noop, effectively introduces the same problem once again.
Comment 14 SpanKY gentoo-dev 2012-05-30 18:43:02 UTC
(In reply to comment #13)

man, that's fsckin brain dead

why was gen_usr_ldscript support added to OS X at all ?  we know why it gets used on Linux systems where Gentoo is booting from, but seeing as we don't boot OS X at all ...

depending on where the /usr merge takes us, this might even become a nop for all targets ...
Comment 15 Fabian Groffen gentoo-dev 2012-05-30 19:40:45 UTC
basically because some components at that time (and might still do) relied on libs being in /lib, like existence checks and stuff like that

Indeed, /usr merge.  Hence, I hope preserve-libs just preserves lib/libz.dylib when usr/lib/libz.dylib is installed, and all is fine (with a rebuild of almost everything).

If you have an ETA here, I'd like to know.  Since I recall Prefix tree having modications to ebuilds that rely on gen_usr_ldscript (ncurses, I think), this means more migration has to be performed than just changing the behaviour of the function.  It is not always as simple as just moving a shared object to another location, in particular on Mach-O systems.

Getting rid of all this stuff would be a plus, though.
Comment 16 SpanKY gentoo-dev 2012-05-30 19:59:45 UTC
(In reply to comment #15)

for packages that make assumptions about a lib being in /usr/lib vs /lib, let's file bugs and get those fixed today.  that's not something packages should need to know at all, and can be done independently of changing gen_usr_ldscript.

as for ETA, this isn't a pressing issue as prefix currently has higher priority over mingw.  so if you need time to sort/test first, that's fine.
Comment 17 Fabian Groffen gentoo-dev 2012-05-30 20:04:48 UTC
I'll try out what happens if I change it in an existing Prefix, as well as if I bootstrap one from scratch with the change.
Comment 18 Naohiro Aota gentoo-dev 2012-06-16 00:18:49 UTC
*** Bug 420087 has been marked as a duplicate of this bug. ***
Comment 19 Fabian Groffen gentoo-dev 2012-06-30 14:54:04 UTC
Ok, I disabled gen_usr_ldscript and performed a fresh bootstrap.  The contents of /lib after `emerge -e system` is as follows:

bash-3.2$ ls lib/
bundle1.o    dylib1.10.5.o    libgcc_s.1.dylib         libncurses.5.dylib
cpp          dylib1.o         libgcc_s.10.4.dylib      libncurses.dylib
crt1.10.5.o  gcrt1.o          libgcc_s.10.5.dylib      libncursesw.5.dylib
crt1.10.6.o  lazydylib1.o     libgcc_s_ppc64.1.dylib   libncursesw.dylib
crt1.o       libcurses.dylib  libgcc_s_x86_64.1.dylib  rcscripts
bash-3.2$ 

That is basically everything gcc-config copies/creates + ncurses + baselayout-prefix.

The ncurses stuff is because that ebuild had to be changed to manually install libs in /lib, otherwise incorrect libs would result.  That needs to be undone, risking major breakage.  I'm going to experiment with undoing this next thing.
Comment 20 Fabian Groffen gentoo-dev 2012-07-18 19:46:43 UTC
changing gen_usr_ldscript to be a noop on existing Darwin prefix systems badly breaks when gettext is updated

Portage can't preserve-libs seems to fail here, even though it preserves lib/libiconv.2.5.1.dylib.  Since lib/libiconv.2.dylib (the "soname") isn't preserved, all breaks.  Unclear to me why still.

Note that nearly everything is linked against gettext (intl/iconv) in non-glibc system.
Comment 21 SpanKY gentoo-dev 2012-07-20 21:16:04 UTC
*** Bug 426416 has been marked as a duplicate of this bug. ***
Comment 22 SpanKY gentoo-dev 2012-07-20 21:18:25 UTC
(In reply to comment #20)

well, we can leave the darwin logic alone (for now).  any reason to keep it for any other system ?  i'd just change the logic to:

case ${CTARGET:-${CHOST}} in
*-darwin*)
    <existing logic>;;
*linux*)
    use prefix && return 0
    <existing logic>;;
*)
    return 0;;
esac
Comment 23 Fabian Groffen gentoo-dev 2012-07-21 14:20:49 UTC
That's fine in principle.  If you allow me some time, I'd like to test this on Solaris and Linux first.

Since we have a copy of the eclass for Prefix, you could also just make the change in gx86.  We'd have to take care not to take over that change.

If you know a way in which we can disable this function for "new" installs, but leave it functioning as is for old/existing installs, that would move things forwards too.
Comment 24 SpanKY gentoo-dev 2012-07-21 16:10:58 UTC
(In reply to comment #23)

i'll make the change in gentoo-x86 (since this is affecting more than prefix systems), and then you can test & post your results here.

http://sources.gentoo.org/eclass/toolchain-funcs.eclass?r1=1.112&r2=1.113
Comment 25 Yuta SATOH 2012-07-25 12:38:34 UTC
Created attachment 319214 [details, diff]
patch for toolchain-funcs.eclass

(In reply to comment #24)
> (In reply to comment #23)
> 
> i'll make the change in gentoo-x86 (since this is affecting more than prefix
> systems), and then you can test & post your results here.
> 
> http://sources.gentoo.org/eclass/toolchain-funcs.eclass?r1=1.112&r2=1.113

Please don't forget the Gentoo/FreeBSD.

toolchain-funcs.eclass
Revision 1.112 

# ls -1 /var/tmp/portage/sys-freebsd/freebsd-lib-9.0-r3/image/lib64/
libalias.so.7
libc.so.7
libcam.so.6
libgeom.so.5
libipsec.so.4
libjail.so.1
libkiconv.so.4
libkvm.so.5
libm.so.5
libmd.so.5
libprocstat.so.1
libsbuf.so.6
libthr.so.3
libufs.so.6
libutil.so.9

Revision 1.113
# ls -1 /var/tmp/portage/sys-freebsd/freebsd-lib-9.0-r3/image/lib64/
libc.so.7
Comment 26 Richard Yao (RETIRED) gentoo-dev 2012-07-25 12:59:39 UTC
(In reply to comment #25)
> Created attachment 319214 [details, diff] [details, diff]
> patch for toolchain-funcs.eclass
> 
> (In reply to comment #24)
> > (In reply to comment #23)
> > 
> > i'll make the change in gentoo-x86 (since this is affecting more than prefix
> > systems), and then you can test & post your results here.
> > 
> > http://sources.gentoo.org/eclass/toolchain-funcs.eclass?r1=1.112&r2=1.113
> 
> Please don't forget the Gentoo/FreeBSD.

We should probably also include Gentoo/OpenBSD and Gentoo/NetBSD in this fix. blueness and maksbotan are looking into reviving Gentoo/OpenBSD and we have a really enthusiatic contributor working to revive Gentoo/NetBSD. It would be best to handle all of the BSDs in a single patch.
Comment 27 Alexis Ballier gentoo-dev 2012-07-25 13:12:43 UTC
(In reply to comment #26)
> (In reply to comment #25)
> > Created attachment 319214 [details, diff] [details, diff] [details, diff]
> > patch for toolchain-funcs.eclass
> > 
> > (In reply to comment #24)
> > > (In reply to comment #23)
> > > 
> > > i'll make the change in gentoo-x86 (since this is affecting more than prefix
> > > systems), and then you can test & post your results here.
> > > 
> > > http://sources.gentoo.org/eclass/toolchain-funcs.eclass?r1=1.112&r2=1.113
> > 
> > Please don't forget the Gentoo/FreeBSD.
> 
> We should probably also include Gentoo/OpenBSD and Gentoo/NetBSD in this
> fix. blueness and maksbotan are looking into reviving Gentoo/OpenBSD and we
> have a really enthusiatic contributor working to revive Gentoo/NetBSD. It
> would be best to handle all of the BSDs in a single patch.

the *linux*) use prefix && return 0 ;; case should be *) use prefix && return 0 ;; imho;

the *linux*) case to generate the ldscript should go back to its ancient *) case, as other targets are matched before.
Comment 28 Yuta SATOH 2012-07-25 13:40:42 UTC
Created attachment 319222 [details, diff]
new patch for toolchain-funcs.eclass

Native Gentoo system will run gen_usr_ldscript.
Comment 29 SpanKY gentoo-dev 2012-07-25 15:28:29 UTC
(In reply to comment #27)

no.  any systems that want this behavior will have to opt in.  the default moving forward is for gen_usr_ldscript to be legacy.

list the exact tuples you care about for bsd systems.
Comment 30 Alexis Ballier gentoo-dev 2012-07-25 16:11:40 UTC
(In reply to comment #29)
> (In reply to comment #27)
> 
> no.  any systems that want this behavior will have to opt in.  the default
> moving forward is for gen_usr_ldscript to be legacy.

what is the rationale behind making this legacy ?

> list the exact tuples you care about for bsd systems.

any non prefix, elf + binutils based system ? opt-out seems saner...
Comment 31 SpanKY gentoo-dev 2012-07-25 16:35:25 UTC
(In reply to comment #30)

as noted elsewhere, /usr merge is happening

as for your proposed prefixes, those don't make sense.  an elf+binutils system is bare metal which means it usually has no filesystem to boot let alone worry about "mounting".  post the bsd tuples you care about and we can add them.
Comment 32 Alexis Ballier gentoo-dev 2012-07-25 17:00:49 UTC
(In reply to comment #31)
> (In reply to comment #30)
> 
> as noted elsewhere, /usr merge is happening

.... on linux

packages moving to /usr will just stop calling gen_usr_ldscript rather than relying on a complex logic in the function anyway.

> as for your proposed prefixes, those don't make sense.  an elf+binutils
> system is bare metal which means it usually has no filesystem to boot let
> alone worry about "mounting".

but the current code will handle it just fine, and anyway, this is under the assumption that if its not prefix then we'd like to reach that point some day...
mingw is more the exception than the rule

> post the bsd tuples you care about and we can
> add them.

_I_ care about *freebsd*, but then see comment #26
I dont see why we should make porting to new systems harder than what it already is.
Comment 33 SpanKY gentoo-dev 2012-07-25 18:26:37 UTC
(In reply to comment #32)

as noted, it isn't just prefix and linux systems where a split /usr makes no sense ... there are less systems that want split /usr than non-split.  mingw isn't the only one.  so no, using a fallback glob makes no sense.

i don't really buy that this makes porting "harder".  the burden here is trivial, and for the systems where it matters (which is small), it's easy to locate.

i've added *-freebsd* to the list of systems which do split /usr.

http://sources.gentoo.org/eclass/toolchain-funcs.eclass?r1=1.113&r2=1.114
Comment 34 Richard Yao (RETIRED) gentoo-dev 2012-07-25 19:49:19 UTC
(In reply to comment #29)
> (In reply to comment #27)
> 
> no.  any systems that want this behavior will have to opt in.  the default
> moving forward is for gen_usr_ldscript to be legacy.
> 
> list the exact tuples you care about for bsd systems.

Who decided this? I use this in sys-fs/zfs and I intend to maintain the split for our users as long as possible. If we must break it, then that is fine, but for now, it appears that everyone is doing what they can to maintain it.

Making this opt-in will give ports an unnecesary pain to debug and quite frankly, it is unnecessary. Why not restrict this to userland_GNU? That is the only place where this merge might happen.

If you insist on making this opt-in, please add openbsd and netbsd to the list. As I noted above, there are efforts to revive the ports. There is no point in giving them yet another issue to debug.
Comment 35 Matt Whitlock 2012-07-25 20:28:49 UTC
Forgive me for possibly being dense, but is there an official Gentoo policy on using /lib versus /usr/lib, which libraries go into which directories, whether the system is supposed to be bootable without /usr/lib, and how *much* of the system is supposed to be bootable without /usr/lib?

If there is no hard and fast rule for determining which libraries are supposed to be in /lib, then we basically have a clusterfsck of conflicting opinions.
Comment 36 SpanKY gentoo-dev 2012-07-25 20:51:54 UTC
(In reply to comment #34)

userland_GNU has nothing to do with it.  if you want to support split /usr in your packages, nothing is stopping you from doing that.  when we get to the day of Linux /usr being merged, we probably will add an IUSE=split-usr flag for people to opt into it on their random systems.

i need the exact tuples for openbsd/netbsd.  i'm not going to try and guess.

(In reply to comment #35)

read the threads on gentoo-dev mailing list
Comment 37 Matt Whitlock 2012-07-25 21:13:58 UTC
I'd personally love a way to opt *out* of the split /usr right now. My /usr is in the same file system as my /, and the presence of the ldscripts in /usr/lib feels like a needless hack for me.

Could there be a FEATURES flag added to Portage that would control whether gen_usr_ldscript does its thing or is a no-op?  Then individual profiles could set it enabled or disabled by default.
Comment 38 Richard Yao (RETIRED) gentoo-dev 2012-07-25 22:45:34 UTC
(In reply to comment #36)
> (In reply to comment #34)
> 
> userland_GNU has nothing to do with it.  if you want to support split /usr
> in your packages, nothing is stopping you from doing that.  when we get to
> the day of Linux /usr being merged, we probably will add an IUSE=split-usr
> flag for people to opt into it on their random systems.
> 
> i need the exact tuples for openbsd/netbsd.  i'm not going to try and guess.

`sed 's/*linux*|*-freebsd*)/*linux*|*-freebsd*|*-openbsd*|*-netbsd*)/'` would work.
Comment 39 SpanKY gentoo-dev 2012-07-26 16:43:52 UTC
(In reply to comment #37)

this isn't the place to debate /usr merge.  take it to the gentoo-dev mailing list (where there have been plenty of threads already).

(In reply to comment #38)

that regex doesn't actually work, but it can deduce what you want from it ;)

http://sources.gentoo.org/eclass/toolchain-funcs.eclass?r1=1.114&r2=1.115
Comment 40 Maciej S. Szmigiero 2012-08-14 20:45:15 UTC
I've tried emerging dev-libs/libiconv in mingw environment (which didn't work before due to this issue; see also bug 420087) and
can confirm that it now installs fine.
Comment 41 William Hubbs gentoo-dev 2012-11-11 00:17:21 UTC
@toolchain:
I would like to ask your opinion on this bug wrt Linux.

Once separate /usr support is implemented with either an initramfs or the busybox[sep-usr] option and we give users time to migrate to one or the other of these two options, which will hide the /usr split, do you feel that we still need this function on Linux, or should we make it optional or drop it??
Comment 42 SpanKY gentoo-dev 2012-11-11 20:27:45 UTC
(In reply to comment #41)

see comment 29 and comment 31 (and probably others)
Comment 43 Michael Haubenwallner (RETIRED) gentoo-dev 2012-11-12 08:14:00 UTC
(In reply to comment #23)
> That's fine in principle.  If you allow me some time, I'd like to test this
> on Solaris and Linux first.

For the records (done within my rather old but stable prefix fork):
AIX: No problem.
HP-UX and Interix: Dynamic linkage stays intact across /lib->/usr/lib move, but removing a shared library in use (fex /lib/libncurses) triggers bug#199868.
Comment 44 William Hubbs gentoo-dev 2012-11-13 21:08:17 UTC
When we get ready to do this, it looks like we may have to  make it an
opt-out setting, or set up a separate profile people can use if they
don't want this to be disabled.

It seems like we have some folks on Linux who are going to refuse to use
initramfs or busybox[sep-usr] no matter what we do.
Comment 45 SpanKY gentoo-dev 2012-11-15 19:08:09 UTC
adding a magic env var for people to set should be easy.  not sure a sep profile is necessary to set a single variable.
Comment 46 Fabian Groffen gentoo-dev 2012-11-15 19:13:14 UTC
In Prefix we currently do such hack:

http://overlays.gentoo.org/proj/alt/browser/trunk/prefix-overlay/eclass/toolchain-funcs.eclass#L637

New bootstraps in Prefix get PREFIX_DISABLE_GEN_USR_LDSCRIPT set to yes in etc/portage/make.conf
Comment 47 William Hubbs gentoo-dev 2013-09-27 18:16:06 UTC
(In reply to William Hubbs from comment #44)
> When we get ready to do this, it looks like we may have to  make it an
> opt-out setting, or set up a separate profile people can use if they
> don't want this to be disabled.
> 
> It seems like we have some folks on Linux who are going to refuse to use
> initramfs or busybox[sep-usr] no matter what we do.

The council has now declared that running without an initramfs or busybox[sep-usr] (preferably an initramfs) is not supported as of 1-Nov-2013.

Therefore, I propose just turning off gen_usr_ldscript on Linux after that date.

Thoughts?

William
Comment 48 William Hubbs gentoo-dev 2013-09-27 18:18:59 UTC
The council has left the way this is handled to maintainer discression.
Comment 49 William Hubbs gentoo-dev 2013-09-27 19:04:30 UTC
Created attachment 359640 [details, diff]
disable-gen-ldscript.patch

@toolchain:
I am not a toolchain maintainer,  but this seems to be the cleanest way
forward.

If you apply this patch, it makes gen_usr_ldscript noop on linux platforms,
but leaves it alone for other platforms where it is still used.

Thoughts about applying this on or after 1 nov would be appreciated.

Thanks,

William
Comment 50 SpanKY gentoo-dev 2013-09-30 05:36:43 UTC
(In reply to William Hubbs from comment #49)

well, we're still going to have calls to gen_usr_ldscript sprinkled in ebuilds to support other systems (like bsd).  so it's not like maintenance costs go down in terms of making sure this func still does what it's supposed to.

i don't really have a problem with this change, but i also would be fine with (i'm assuming i got the logic right ... haven't tested):

    if [[ -z ${GENTOO_ENABLE_SPLIT_USR} ]] ; then
        case ${CTARGET:-${CHOST}} in
        *-darwin*) GENTOO_ENABLE_SPLIT_USR='yes' ;;
        *-freebsd*|*-openbsd*|*-netbsd*)
            use prefix || GENTOO_ENABLE_SPLIT_USR='yes' ;;
        esac
    fi
    if [[ ${GENTOO_ENABLE_SPLIT_USR} != "yes" ]] ; then
        return 0
    fi
Comment 51 Fabian Groffen gentoo-dev 2013-09-30 07:23:48 UTC
Because also on Darwin I want to move away from this, the Prefix overlay uses a version of gen_usr_ldscript that listens to a special var that disables gen_usr_ldscript.

Perhaps something like this would work for everyone involved here if we'd set it through a (new) profile?
Comment 52 SpanKY gentoo-dev 2013-09-30 17:58:25 UTC
(In reply to Fabian Groffen from comment #51)

that was the reason i wrote the code above.  with that in place, your prefix overlays can explicitly set that var to "no" and it'll disable things.
Comment 53 Fabian Groffen gentoo-dev 2013-09-30 18:10:58 UTC
(In reply to SpanKY from comment #52)
> that was the reason i wrote the code above.  with that in place, your prefix
> overlays can explicitly set that var to "no" and it'll disable things.

Ah, yes... needed more coffee this morning.  Sorry
Comment 54 SpanKY gentoo-dev 2013-10-02 22:18:38 UTC
(In reply to SpanKY from comment #50)

if there's no other feedback, i'll probably merge this in the next week
Comment 55 William Hubbs gentoo-dev 2013-10-23 17:09:11 UTC
(In reply to Fabian Groffen from comment #53)
> (In reply to SpanKY from comment #52)
> > that was the reason i wrote the code above.  with that in place, your prefix
> > overlays can explicitly set that var to "no" and it'll disable things.
> 
> Ah, yes... needed more coffee this morning.  Sorry

@grobian:
I'm a little lost here. Why does it matter whether libraries go in /lib* or /usr/lib* on prefix? The only reason I know of for putting libraries in /lib* is so that systems can boot, but prefixes don't boot, so I'm a bit confused about why you would even need gen_usr_ldscript to do anything at all on prefix.
Comment 56 Fabian Groffen gentoo-dev 2013-10-23 17:54:54 UTC
(In reply to William Hubbs from comment #55)

Historical mistake, we decided to follow Gentoo Linux closely, including gen_usr_ldscript.  FYI, new Prefix bootstraps already disable the use of it.

Darwin/Mach-O stores absolute references to shared libraries, hence if you move them, you simply break all applications that rely on it.  preserve-libs helps a lot in this case, but it isn't quite perfect, therefore I didn't just disable it globally through the profiles yet.  All existing prefixes that I changed this setting for in the past have broken sofar (Darwin/Solaris), usually on zlib.
Comment 57 SpanKY gentoo-dev 2013-12-12 19:43:27 UTC
revised version:

# Eventually we'd like to get rid of this func completely #417451
if [[ -z ${GENTOO_ENABLE_SPLIT_USR} ]] ; then
  case ${CTARGET:-${CHOST}} in
  *-darwin*) GENTOO_ENABLE_SPLIT_USR='yes' ;;
  *-freebsd*|*-openbsd*|*-netbsd*)
    use prefix || GENTOO_ENABLE_SPLIT_USR='yes' ;;
  *linux*)
    # Do a sanity check on users to see if they have a split-/usr.
    # If so, for now, we warn & still do this stuff.
    # The ROOT hack isn't entirely correct, but we don't really care.
    # If you're deploying binpkgs, you can sort it out yourself.
    if [[ ${ROOT} == "/" && $(stat -c %d /) != "$(stat -c %d /usr)" ]] ; then
      ewarn "You have a /usr mount point, but have not set GENTOO_ENABLE_SPLIT_USR=yes"
      ewarn "in your make.conf.  Please do so now as future builds will stop setting"
      ewarn "this for you automatically and your system might stop booting."
      ewarn "See http://bugs.gentoo.org/417451 for more details."
      GENTOO_ENABLE_SPLIT_USR='yes'
    fi
    ;;
  esac
fi
if [[ ${GENTOO_ENABLE_SPLIT_USR} != "yes" ]] ; then
  return 0
fi
Comment 58 William Hubbs gentoo-dev 2015-01-20 17:19:03 UTC
Ping, where are we on this bug?
Comment 59 William Hubbs gentoo-dev 2015-01-20 17:25:16 UTC
Created attachment 394428 [details, diff]
gen_usr_ldscript.patch

@vapier:
This is the patch that implements the last suggestion.
Comment 60 SpanKY gentoo-dev 2015-02-15 06:05:45 UTC
Comment on attachment 394428 [details, diff]
gen_usr_ldscript.patch

>+		*Linux*)

you've added a minor but significant error ;).  my version had "*linux*".

at any rate, we need a news item put together before this is committed.  feel like doing that and i'll take care of pushing the eclass update ?
Comment 61 Larry the Git Cow gentoo-dev 2019-07-18 15:13:25 UTC
The bug has been referenced in the following commit(s):

https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=cc8063d4318a6594ac8ae94e99c2a6fe484198bd

commit cc8063d4318a6594ac8ae94e99c2a6fe484198bd
Author:     Mike Gilbert <floppym@gentoo.org>
AuthorDate: 2019-07-14 20:17:43 +0000
Commit:     Mike Gilbert <floppym@gentoo.org>
CommitDate: 2019-07-18 15:13:13 +0000

    usr-ldscript.eclass: return early if USE=split-usr is disabled
    
    Bug: https://bugs.gentoo.org/417451
    Signed-off-by: Mike Gilbert <floppym@gentoo.org>

 eclass/usr-ldscript.eclass | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)
Comment 62 Sergei Trofimovich (RETIRED) gentoo-dev 2019-11-11 23:29:17 UTC
Closing as IUSE=split-usr is an available knob to opt out of ldscript.