public inbox for gentoo-dev@lists.gentoo.org
 help / color / mirror / Atom feed
* [gentoo-dev] rfc: toolchain-funcs: target-has-split-usr API?
@ 2013-04-12 20:04 Gregory M. Turner
  2013-04-14  4:56 ` [gentoo-dev] " Ryan Hill
  0 siblings, 1 reply; 3+ messages in thread
From: Gregory M. Turner @ 2013-04-12 20:04 UTC (permalink / raw
  To: Gentoo Dev

What do people think of something like this?  Obviously the equivalent 
patch to prefix would need to include a test for 
PREFIX_DISABLE_GEN_USR_LDSCRIPT:

Author: Gregory M. Turner <gmturner007@ameritech.net>
Date:   Fri Apr 12 11:13:21 2013 -0700

     eclass/toolchain-funcs: Add target-has-split-usr API

     Move the platform-filtering code from gen_usr_ldscript into its own
     API so that ebuilds can reliably test whether gen_usr_ldscript does
     something or not in the currently applicable environment.  See
     in-source comments for more details.

     Signed-off-by: Gregory M. Turner <gmturner007@ameritech.net>

diff --git a/eclass/toolchain-funcs.eclass b/eclass/toolchain-funcs.eclass
index 9b94512..7600aaf 100644
--- a/eclass/toolchain-funcs.eclass
+++ b/eclass/toolchain-funcs.eclass
@@ -604,6 +604,36 @@ gcc-specs-nostrict() {
      return $([[ "${directive/\{!fstrict-overflow:}" != "${directive}" ]])
  }

+# @FUNCTION: target-has-split-usr
+# @DESCRIPTION:
+# This function returns 0 (true) if, for the currently
+# targeted platform, portage is presuming that a "split-usr"
+# configuration must be maintained.  When target-has-split-usr
+# returns a nonzero (false) value, gen_usr_ldscript is a noop. This
+# may be handy in cases where an ebuild needs to decide, i.e., whether
+# it makes sense to move certain files from /usr/bin to /bin
+# in an ebuild.  In the future, the assumption that "critical"
+# stuff ends up in "/bin" and "/$(libdir)" whereas "noncritical"
+# stuff ends up in "/usr/bin" and "/usr/$(libdir)" may be removed
+# from portage entirely, or relegated to a legacy-support role.
+# As of April 2013, discussion was ongoing in the Gentoo developer
+# community as to what exactly to change and how (see bug #417451).
+# By predicating ebuild code on target-has-split-usr, which exists solely
+# to maintain a split-usr layout, ebuilds can future-proof themselves
+# against changes to the precise criteria that determine whether or not
+# split-usr is in effect for a given target and configuration.
+target-has-split-usr() {
+    tc-is-static-only && return 1
+
+    case ${CTARGET:-${CHOST}} in
+    *-darwin*) return 0;;
+    *linux*|*-freebsd*|*-openbsd*|*-netbsd*)
+        use prefix && return 1
+        return 0
+        ;;
+    *) return 1 ;;
+    esac
+}

  # @FUNCTION: gen_usr_ldscript
  # @USAGE: [-a] <list of libs to create linker scripts for>
@@ -620,19 +650,10 @@ gcc-specs-nostrict() {
  # the library (libfoo.so), as ldconfig should usually update it
  # correctly to point to the latest version of the library present.
  gen_usr_ldscript() {
+    target-has-split-usr || return 0
      local lib libdir=$(get_libdir) output_format="" auto=false 
suffix=$(get_libname)
      [[ -z ${ED+set} ]] && local ED=${D%/}${EPREFIX}/

-    tc-is-static-only && return
-
-    # Eventually we'd like to get rid of this func completely #417451
-    case ${CTARGET:-${CHOST}} in
-    *-darwin*) ;;
-    *linux*|*-freebsd*|*-openbsd*|*-netbsd*)
-        use prefix && return 0 ;;
-    *) return 0 ;;
-    esac
-
      # Just make sure it exists
      dodir /usr/${libdir}


-- 
gmt


^ permalink raw reply related	[flat|nested] 3+ messages in thread

* [gentoo-dev] Re: rfc: toolchain-funcs: target-has-split-usr API?
  2013-04-12 20:04 [gentoo-dev] rfc: toolchain-funcs: target-has-split-usr API? Gregory M. Turner
@ 2013-04-14  4:56 ` Ryan Hill
  2013-04-14  8:24   ` Gregory M. Turner
  0 siblings, 1 reply; 3+ messages in thread
From: Ryan Hill @ 2013-04-14  4:56 UTC (permalink / raw
  To: gentoo-dev

[-- Attachment #1: Type: text/plain, Size: 867 bytes --]

On Fri, 12 Apr 2013 13:04:57 -0700
"Gregory M. Turner" <gmt@malth.us> wrote:

> What do people think of something like this?  Obviously the equivalent 
> patch to prefix would need to include a test for 
> PREFIX_DISABLE_GEN_USR_LDSCRIPT:
> 
> Author: Gregory M. Turner <gmturner007@ameritech.net>
> Date:   Fri Apr 12 11:13:21 2013 -0700
> 
>      eclass/toolchain-funcs: Add target-has-split-usr API
> 
>      Move the platform-filtering code from gen_usr_ldscript into its own
>      API so that ebuilds can reliably test whether gen_usr_ldscript does
>      something or not in the currently applicable environment.  See
>      in-source comments for more details.
> 
>      Signed-off-by: Gregory M. Turner <gmturner007@ameritech.net>

File a bug with the maintainers of that eclass.


-- 
gcc-porting
toolchain, wxwidgets
@ gentoo.org

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 490 bytes --]

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [gentoo-dev] Re: rfc: toolchain-funcs: target-has-split-usr API?
  2013-04-14  4:56 ` [gentoo-dev] " Ryan Hill
@ 2013-04-14  8:24   ` Gregory M. Turner
  0 siblings, 0 replies; 3+ messages in thread
From: Gregory M. Turner @ 2013-04-14  8:24 UTC (permalink / raw
  To: gentoo-dev

On 4/13/2013 9:56 PM, Ryan Hill wrote:
> On Fri, 12 Apr 2013 13:04:57 -0700
> "Gregory M. Turner" <gmt@malth.us> wrote:
>
>> What do people think of something like this?  Obviously the equivalent
>> patch to prefix would need to include a test for
>> PREFIX_DISABLE_GEN_USR_LDSCRIPT:
>>
>> Author: Gregory M. Turner <gmturner007@ameritech.net>
>> Date:   Fri Apr 12 11:13:21 2013 -0700
>>
>>       eclass/toolchain-funcs: Add target-has-split-usr API
>>
>>       Move the platform-filtering code from gen_usr_ldscript into its own
>>       API so that ebuilds can reliably test whether gen_usr_ldscript does
>>       something or not in the currently applicable environment.  See
>>       in-source comments for more details.
>>
>>       Signed-off-by: Gregory M. Turner <gmturner007@ameritech.net>
> File a bug with the maintainers of that eclass.
That's my plan, but I first wanted to give the wider audience on this 
list the opportunity to voice any opinions on the matter.

-gmt


^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2013-04-14  8:24 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-04-12 20:04 [gentoo-dev] rfc: toolchain-funcs: target-has-split-usr API? Gregory M. Turner
2013-04-14  4:56 ` [gentoo-dev] " Ryan Hill
2013-04-14  8:24   ` Gregory M. Turner

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox