Date: Sat, 28 May 2016 10:40:59 -0700 From: Mark Millard <markmi@dsl-only.net> To: Bryan Drewery <bdrewery@FreeBSD.org> Cc: FreeBSD Current <freebsd-current@freebsd.org>, FreeBSD Toolchain <freebsd-toolchain@freebsd.org>, FreeBSD PowerPC ML <freebsd-ppc@freebsd.org>, Gerald Pfeifer <gerald@FreeBSD.org>, Warner Losh <imp@bsdimp.com>, Dimitry Andric <dim@FreeBSD.org> Subject: Re: svn commit: r297435 - head: still problems for stage 3 when gcc 4.2.1 is avoided (powerpc64 self-hosted build) Message-ID: <068D322F-E46F-4FD8-8DA0-BD7D17FD2A06@dsl-only.net> In-Reply-To: <0FA52C68-43C4-489D-9EB2-2339C2B812F5@dsl-only.net> References: <5A0ACA76-6F1D-4975-9E59-2A64BB8EFC77@dsl-only.net> <56FD9757.6040709@FreeBSD.org> <9E3033D5-F416-4B78-97C2-0A0AABF5A49E@dsl-only.net> <56FDA5F9.1090601@FreeBSD.org> <481DA341-0DFC-4AF1-AD4D-56C5388FA8E3@dsl-only.net> <56FDBAA8.5060407@FreeBSD.org> <7DEF97EC-D970-4F64-AF72-8939609A1D48@dsl-only.net> <DD969902-BCA8-480B-B32F-07DCC6C3E32B@dsl-only.net> <db60bcec-a6c4-02ac-da6c-1ac70821b806@FreeBSD.org> <4953F764-FC4E-491F-A6B7-4CAF65EAAEB7@dsl-only.net> <70a54660-775d-c12c-b991-507d26ce1342@FreeBSD.org> <72F5F9FD-5854-455D-8844-C4E1887DCE9F@dsl-only.net> <C23B8A92-8855-48CE-B442-3C7BEFCEF820@dsl-only.net> <0FA52C68-43C4-489D-9EB2-2339C2B812F5@dsl-only.net>
index | next in thread | previous in thread | raw e-mail
[Top post of failure to get rid of /usr/local/include from devel/powerpc64-gcc search list.]
I have tried:
> # svnlite diff /usr/ports/devel/powerpc64-gcc/
> Index: /usr/ports/devel/powerpc64-gcc/Makefile
> ===================================================================
> --- /usr/ports/devel/powerpc64-gcc/Makefile (revision 415874)
> +++ /usr/ports/devel/powerpc64-gcc/Makefile (working copy)
> @@ -43,6 +43,7 @@
> CONFIGURE_ARGS+=--target=${GCC_TARGET} --disable-nls --enable-languages=c,c++ \
> --without-headers \
> --with-gmp=${LOCALBASE} \
> + --with-local-prefix=${LOCALBASE}/lib/gcc/${GCC_TARGET}/${PORTVERSION} \
> --with-pkgversion="FreeBSD Ports Collection for ${PKGNAMEPREFIX:C/-//g}" \
> --with-system-zlib \
> --with-as=${LOCALBASE}/bin/${BU_PREFIX}-as \
which when rebuilt in a powerpc64 context shows up with:
--with-local-prefix=/usr/local/lib/gcc/powerpc64-portbld-freebsd11.0/5.3.0
in the "Configured with" (from using -v):
> Target: powerpc64-portbld-freebsd11.0
> Configured with: /usr/obj/portswork/usr/ports/devel/powerpc64-gcc/work/gcc-5.3.0/configure --target=powerpc64-portbld-freebsd11.0 --disable-nls --enable-languages=c,c++ --without-headers --with-gmp=/usr/local --with-local-prefix=/usr/local/lib/gcc/powerpc64-portbld-freebsd11.0/5.3.0 --with-pkgversion='FreeBSD Ports Collection for powerpc64' --with-system-zlib --with-as=/usr/local/bin/powerpc64-freebsd-as --with-ld=/usr/local/bin/powerpc64-freebsd-ld --prefix=/usr/local --localstatedir=/var --mandir=/usr/local/man --infodir=/usr/local/info/ --build=powerpc64-portbld-freebsd11.0
But /usr/local/include still shows up in the search list, for example:
> ignoring nonexistent directory "/usr/obj/xtoolchain_noclang/powerpc.powerpc64/usr/src/tmp/usr/local/lib/gcc/powerpc64-portbld-freebsd11.0/5.3.0/include"
> ignoring nonexistent directory "/usr/local/lib/gcc/powerpc64-portbld-freebsd11.0/5.3.0/../../../../powerpc64-portbld-freebsd11.0/include"
> ignoring duplicate directory "/usr/obj/xtoolchain_noclang/powerpc.powerpc64/usr/src/tmp/usr/include"
> #include "..." search starts here:
> #include <...> search starts here:
> /usr/src/lib/msun/powerpc
> /usr/src/lib/msun/src
> /usr/src/lib/libc/include
> /usr/src/lib/libc/powerpc
> /usr/obj/xtoolchain_noclang/powerpc.powerpc64/usr/src/tmp/usr/include
> /usr/local/lib/gcc/powerpc64-portbld-freebsd11.0/5.3.0/include
> /usr/local/include
> /usr/local/lib/gcc/powerpc64-portbld-freebsd11.0/5.3.0/include-fixed
> End of search list.
[Despite some prior mis-wording in other messages: The line match for --with-local-prefix= 's value with "/include" appended matches the line prior to /usr/local/include in the search list, not the following line.]
So far I'm unsuccessful at avoiding /usr/local/include being in the search list. I'm still at the stage of C_INCLUDE_PAPTH and CPLUS_INCLUDE_PATH being the best means that I've found to force /usr/include based paths to win when there are conflicts in /usr/local/include from ports that have been built.
So far I'm only doing the experiment with devel/powerpc64-gcc (used as the so-called "cross compiler" in my powerpc64 self-hosted context), not with the lang/gcc49 that I use as the system compiler. For lang/gcc49 I'm still using C_INCLUDE_PAPTH and CPLUS_INCLUDE_PATH to avoid /usr/local/include based paths from finding files. In part this is because I expect port building problems if I use lang/gcc49 to build ports without lang/gcc49 having /usr/local/include implicitly. I do not use devel/powerpc64-gcc to build ports.
===
Mark Millard
markmi at dsl-only.net
On 2016-May-28, at 2:24 AM, Mark Millard <markmi at dsl-only.net> wrote:
> --with-local-prefix=/usr was insufficient to avoid /usr/local/include in the search list in powerpc64-gcc:
>
>> ignoring duplicate directory "/usr/obj/xtoolchain_noclang/powerpc.powerpc64/usr/src/tmp/usr/include"
>> ignoring nonexistent directory "/usr/local/lib/gcc/powerpc64-portbld-freebsd11.0/5.3.0/../../../../powerpc64-portbld-freebsd11.0/include"
>> ignoring duplicate directory "/usr/obj/xtoolchain_noclang/powerpc.powerpc64/usr/src/tmp/usr/include"
>> #include "..." search starts here:
>> #include <...> search starts here:
>> /usr/src/gnu/lib/libssp/libssp_nonshared/..
>> /usr/src/gnu/lib/libssp/libssp_nonshared/../../../../contrib/gcclibs/libssp
>> /usr/src/gnu/lib/libssp/libssp_nonshared/../../../../contrib/gcclibs/include
>> /usr/obj/xtoolchain_noclang/powerpc.powerpc64/usr/src/tmp/usr/include
>> /usr/local/lib/gcc/powerpc64-portbld-freebsd11.0/5.3.0/include
>> /usr/local/include
>> /usr/local/lib/gcc/powerpc64-portbld-freebsd11.0/5.3.0/include-fixed
>> End of search list.
>
> Which came from (which shows the --with-local-prefix=/usr use):
>
>> Configured with: /usr/obj/portswork/usr/ports/devel/powerpc64-gcc/work/gcc-5.3.0/configure --target=powerpc64-portbld-freebsd11.0 --disable-nls --enable-languages=c,c++ --without-headers --with-gmp=/usr/local --with-local-prefix=/usr --with-pkgversion='FreeBSD Ports Collection for powerpc64' --with-system-zlib --with-as=/usr/local/bin/powerpc64-freebsd-as --with-ld=/usr/local/bin/powerpc64-freebsd-ld --prefix=/usr/local --localstatedir=/var --mandir=/usr/local/man --infodir=/usr/local/info/ --build=powerpc64-portbld-freebsd11.0
>
> In Makefile terms:
>
>> # svnlite diff /usr/ports/devel/powerpc64-gcc/Makefile
>> Index: /usr/ports/devel/powerpc64-gcc/Makefile
>> ===================================================================
>> --- /usr/ports/devel/powerpc64-gcc/Makefile (revision 415874)
>> +++ /usr/ports/devel/powerpc64-gcc/Makefile (working copy)
>> @@ -43,6 +43,7 @@
>> CONFIGURE_ARGS+=--target=${GCC_TARGET} --disable-nls --enable-languages=c,c++ \
>> --without-headers \
>> --with-gmp=${LOCALBASE} \
>> + --with-local-prefix=/usr \
>> --with-pkgversion="FreeBSD Ports Collection for ${PKGNAMEPREFIX:C/-//g}" \
>> --with-system-zlib \
>> --with-as=${LOCALBASE}/bin/${BU_PREFIX}-as \
>
>
> Note: "Specifying --prefix has no effect on which directory GCC searches for local header files".
>
> Some interesting wording is: "The same value can be used for both --with-local-prefix and --prefix provided it is not /usr" and "This can be used to avoid the default search of /usr/local/include". Also: "The purpose of --prefix is to specify where to install GCC" and "The local header files in /usr/local/include—if you put any in that directory—are not part of GCC".
>
> My overall interpretation of that is that in my context:
>
> --with-local-prefix=/usr/local/lib/gcc/powerpc64-portbld-freebsd11.0/5.3.0
>
> a.k.a.:
>
> --with-local-prefix=${LOCALBASE}/lib/gcc/${GCC_TARGET}/${PORTVERSION}
>
> would make for a redundant overall search path without changing the ordering.
>
> I have not figured out why /usr/local/include continued to show up and /usr/include did not. I wonder if they have special logic for if /usr is assigned and so force back there specified default.
>
> I'll try rebuilding devel/powerpc64-gcc again based on:
>
> --with-local-prefix=${LOCALBASE}/lib/gcc/${GCC_TARGET}/${PORTVERSION}
>
>
>
> ===
> Mark Millard
> markmi at dsl-only.net
help
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?068D322F-E46F-4FD8-8DA0-BD7D17FD2A06>
