--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 On 2016-May-27, at 7:35 PM, Mark Millard <markmi at dsl-only.net> wrote: > On 2016-May-27, at 7:04 PM, Mark Millard <markmi at dsl-only.net> wrote: > >> FYI. . . >> >> I expect that building gcc49 with: >> >> + --with-local-prefix=/usr \ >> >> will help with system build activities via gcc49/g++49 by avoiding >> /usr/local/include interfering. >> >> But I also expect that various port builds based on that same gcc49/g++49 >> will have problems from not explicitly forcing /usr/local/include to be >> looked at when appropriate/required --unless something else is in place to >> do that separately. I expect some implicit /usr/local/include references to >> the likes of some of the below list: >> >>> # diff -qr /usr/include/ /usr/local/include/ | grep /local/ | more >>> Only in /usr/local/include/: apr-1 >>> Files /usr/include/atf-c/defs.h and /usr/local/include/atf-c/defs.h differ >>> Only in /usr/local/include/: autosprintf.h >>> Only in /usr/local/include/: bfd.h >>> Only in /usr/local/include/: bfdlink.h >>> Only in /usr/local/include/: boost >>> Only in /usr/local/include/: curl >>> Only in /usr/local/include/: db5 >>> Only in /usr/local/include/: dis-asm.h >>> Files /usr/include/dwarf.h and /usr/local/include/dwarf.h differ >>> Only in /usr/local/include/: editline >>> Only in /usr/local/include/: expat.h >>> Only in /usr/local/include/: expat_config.h >>> Only in /usr/local/include/: expat_external.h >>> Only in /usr/local/include/: ffi.h >>> Only in /usr/local/include/: ffitarget.h >>> Only in /usr/local/include/: gdbm.h >>> Only in /usr/local/include/: gettext-po.h >>> Only in /usr/local/include/: gmp.h >>> Only in /usr/local/include/: gmpxx.h >>> Only in /usr/local/include/: gnumake.h >>> Files /usr/include/histedit.h and /usr/local/include/histedit.h differ >>> Only in /usr/local/include/: idn-free.h >>> Only in /usr/local/include/: idn-int.h >>> Only in /usr/local/include/: idna.h >>> Only in /usr/local/include/: layout >>> Files /usr/include/libdwarf.h and /usr/local/include/libdwarf.h differ >>> Only in /usr/local/include/: libintl.h >>> Only in /usr/local/include/: lua52 >>> Only in /usr/local/include/: lutok >>> Only in /usr/local/include/: mpc.h >>> Only in /usr/local/include/: mpf2mpfr.h >>> Only in /usr/local/include/: mpfr.h >>> Only in /usr/local/include/: pkg.h >>> Only in /usr/local/include/: plugin-api.h >>> Only in /usr/local/include/: pr29.h >>> Only in /usr/local/include/: punycode.h >>> Only in /usr/local/include/: python2.7 >>> Only in /usr/local/include/: readline >>> Only in /usr/local/include/: ruby-2.2 >>> Only in /usr/local/include/: serf-1 >>> Only in /usr/local/include/: sqlite3.h >>> Only in /usr/local/include/: sqlite3ext.h >>> Only in /usr/local/include/: stringprep.h >>> Only in /usr/local/include/: subversion-1 >>> Only in /usr/local/include/: sudo_plugin.h >>> Only in /usr/local/include/: symcat.h >>> Only in /usr/local/include/: tld.h >>> Only in /usr/local/include/: unicode >>> Only in /usr/local/include/: yaml.h >> >> It might be that even gcc compilers built by the adjusted gcc49 would not >> find, say, gmp.h or mpfr.h . >> >> dwarfdump's build/install installs /usr/local/include/dwarf.h and >> /usr/local/include/libdwarf.h to match its code. Such examples can need >> careful control over which file is used (here dwarf.h and libdwarf.h in >> /usr/include vs. /usr/local/include ). >> >> (It will still be some time before I get to switch to this with-local-prefix >> experiment.) >> >> === >> Mark Millard >> markmi at dsl-only.net > > Given the above I may try using > > + --with-local-prefix=/usr \ > > only for building devel/powerpc64-gcc initially because I do not use > devel/powerpc64-gcc to build ports, just for system-build activities. > devel/powerpc64-gcc has the /usr/local/include problem for system build > activities too. > > === > Mark Millard > markmi at dsl-only.net > > On 2016-May-27, at 5:23 PM, Bryan Drewery <bdrewery at FreeBSD.org> wrote: > On 5/27/2016 5:15 PM, Mark Millard wrote: >> + --with-local-prefix=/usr/include \ >> >> looks wrong to me. The default is not /usr/local/include but just /usr/local >> . Quoting https://gcc.gnu.org/install/configure.html : >> >> --with-local-prefix=dirname >> Specify the installation directory for local include files. The default is >> /usr/local. Specify this option if you want the compiler to search directory >> dirname/include for locally installed header files instead of >> /usr/local/include. >> >> So your change would generate /usr/include/include for the overall include >> path from what I can tell. >> >> Do you want: >> >> + --with-local-prefix=/usr \ >> >> instead? > > You're right, but it makes no real difference since it removes > /usr/local/include: > >> ignoring nonexistent directory >> "/root/svn/ports/lang/gcc49/work/stage/usr/local/bin/../lib/gcc49/gcc/x86_64-portbld-freebsd11.0/4.9.4/../../../../../x86_64-portbld-freebsd11.0/include" >> ignoring duplicate directory >> "/root/svn/ports/lang/gcc49/work/stage/usr/local/bin/../lib/gcc49/gcc/../../../lib/gcc49/gcc/x86_64-portbld-freebsd11.0/4.9.4/include" >> ignoring nonexistent directory "/usr/include/include" > > ^ yes wrong > >> ignoring duplicate directory >> "/root/svn/ports/lang/gcc49/work/stage/usr/local/bin/../lib/gcc49/gcc/../../../lib/gcc49/gcc/x86_64-portbld-freebsd11.0/4.9.4/include-fixed" >> ignoring nonexistent directory >> "/root/svn/ports/lang/gcc49/work/stage/usr/local/bin/../lib/gcc49/gcc/../../../lib/gcc49/gcc/x86_64-portbld-freebsd11.0/4.9.4/../../../../../x86_64-portbld-freebsd11.0/include" >> #include "..." search starts here: >> #include <...> search starts here: >> /root/svn/ports/lang/gcc49/work/stage/usr/local/bin/../lib/gcc49/gcc/x86_64-portbld-freebsd11.0/4.9.4/include >> /root/svn/ports/lang/gcc49/work/stage/usr/local/bin/../lib/gcc49/gcc/x86_64-portbld-freebsd11.0/4.9.4/include-fixed >> /root/svn/ports/lang/gcc49/work/stage/usr/local/bin/../lib/gcc49/gcc/../../../include >> /usr/include > > ^ Still added > >> End of search list. > > > > -- > Regards, > Bryan Drewery > > _______________________________________________ freebsd-toolchain@freebsd.org mailing list https://lists.freebsd.org/mailman/listinfo/freebsd-toolchain To unsubscribe, send any mail to "freebsd-toolchain-unsubscr...@freebsd.org"