pkgsrc-Users archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

Re: trouble with 2017Q3 bootstrap on Solaris 10 SPARC



Thanks Julien. I think my situation may be different using --prefix= while
you are not.

From the last two lines in work/wrk/sysutils/bsdinstall/work/.work.log, I
could see that cwrapper was erroneously replacing -Wl,-R with -Wl,-rpath,.
[*] cc -v -D_FORTIFY_SOURCE=2 '-D_PATH_DEVNULL=\"/dev/null\"'
'-DTARGET_STRIP=\"/usr/ccs/bin/strip\"' -DHAVE_NBCOMPAT_H=1
-I/export/home/pkgsrc/2017Q3/pkgsrc/bootstrap/work/wrk/sysutils/bsdinstall/work/libnbcompat
-D_FILE_OFFSET_BITS=64 -D_LARGEFILE_SOURCE
-L/export/home/pkgsrc/2017Q3/pkgsrc/bootstrap/work/wrk/sysutils/bsdinstall/work/libnbcompat
-Wl,-R/export/home/pkgsrc/2017Q3/lib conftest.c
<.>
/export/home/pkgsrc/2017Q3/pkgsrc/bootstrap/work/wrk/sysutils/bsdinstall/work/.gcc/bin/gcc
-m32 -v -D_FORTIFY_SOURCE=2 '-D_PATH_DEVNULL=\"/dev/null\"'
'-DTARGET_STRIP=\"/usr/ccs/bin/strip\"' -DHAVE_NBCOMPAT_H=1
-I/export/home/pkgsrc/2017Q3/pkgsrc/bootstrap/work/wrk/sysutils/bsdinstall/work/libnbcompat
-D_FILE_OFFSET_BITS=64 -D_LARGEFILE_SOURCE
-L/export/home/pkgsrc/2017Q3/pkgsrc/bootstrap/work/wrk/sysutils/bsdinstall/work/libnbcompat
-Wl,-rpath,/export/home/pkgsrc/2017Q3/lib conftest.c -D_FORTIFY_SOURCE=2
-fstack-protector
-I/export/home/pkgsrc/2017Q3/pkgsrc/bootstrap/work/wrk/sysutils/bsdinstall/work/.buildlink/include

After adding some tracing to cwrapper and doing some tests, I confirmed
that this replacement is hard coded normalise_cc(). This will not work with
gcc on Solaris configured by recommendations to use /usr/ccs/bin/ld. Even
though generic_transform_cc() is called after normalise_cc(), I was not
able to find a generic transform:opt rule for .cwrapper/config//cc that
would undo it. But a crude localized replacement did work. I added to
mk/platform/SunOS.mk:
BUILDLINK_TRANSFORM+=
opt:-Wl,-rpath,/export/home/pkgsrc/2017Q3/lib:-Wl,-R/export/home/pkgsrc/2017Q3/lib
Someone more familiar with cwrapper may have a better way to accomplish this!

This let the bootstrap build successfully. But in the mean time, 2017Q4 is
available :-), so I am going to start fresh with it.

- Andy Hooper

On 2017-12-30 2:08 PM, Julien Savard wrote:
> Hi,
> I had issue too with ld on Solaris 10 with pkgsrc-2017Q3 but not on
> bootstraping (see :
> http://mail-index.netbsd.org/pkgsrc-users/2017/12/28/msg026033.html
> ). 
> I don't know if it can help you but here is how I bootstrap pkgsrc (  Did
> yesterday on a Solaris 10 zone ).
> 
> When using SFW GCC 3.4.3 :
> 
>     echo "Hacking pkgsrc to work with SFW GCC"
>     perl -pi -e 's|_OPSYS_SUPPORTS_SSP=    yes|_OPSYS_SUPPORTS_SSP=   
>     no|g' /usr/pkgsrc/mk/platform/SunOS.mk
> 
>     echo "Bootstraping pkgsrc"
>     cd /usr/pkgsrc/bootstrap
>     env CC=/usr/sfw/bin/gcc CPP=/usr/sfw/bin/cpp CXX=/usr/sfw/bin/cpp
>     CFLAGS='-O2' GCCBASE=/usr/sfw ./bootstrap --abi=64 | tee bootstrap.log
> 
> When using OpenCSW GCC 4.9 or 5.5 :
> 
>     echo "Bootstraping pkgsrc"
>     cd /usr/pkgsrc/bootstrap
>     env CC=/opt/csw/bin/gcc CPP=/opt/csw/bin/cpp CXX=opt/csw/bin/cpp
>     CFLAGS='-O2' GCCBASE=/opt/csw/bin ./bootstrap --abi=64 | tee bootstrap.log
> 
> As far I remember, at this point you will face a circular depedency when
> compiling lot of packages. Most of them you try to fetch their tarball
> using nbftp including ncurse which is required to compile nbftp itself.
> Ncurse is not installed on my Solaris systems. The quick workaround I
> suggest you would be to compile and install "fetch" (which does not require
> ncurse) and then add this to you mk.conf file :
> 
> 
>     FETCH_USING=            fetch
> 
> Hope it helps...
> 
> 
> On Fri, Dec 29, 2017 at 10:22 AM, Andy Hooper <hooper%queensu.ca@localhost
> <mailto:hooper%queensu.ca@localhost>> wrote:
> 
>     env CC=/home/pkgsrc/gcc49/bin/gcc GCCBASE=/home/pkgsrc/gcc49 ./bootstrap
>     --abi=32 --prefix=/export/home/pkgsrc/2017Q3 --unprivileged
>     ...
>     ===> Installing dependencies for bsdinstall-20160108
>     => Configuring and building libnbcompat
>     ...
>     checking whether the C compiler works... no
>     configure: error: in
>     `/export/home/pkgsrc/2017Q3/pkgsrc/bootstrap/work/wrk/sysutils/bsdinstall/work/libnbcompat':
>     configure: error: C compiler cannot create executables
> 
>     >From config.log this is due to:
>     ld: fatal: option -dn and -P are incompatible
> 
>     Where is ld getting a -P option? Passing CFLAGS=-v in to bootstrap, this
>     appears to be due to an option '-rpath' passed through gcc collect2.
> 
>      /home/pkgsrc/gcc49/libexec/gcc/sparc-sun-solaris2.10/4.9.4/collect2 -V -Y
>     P,/usr/ccs/lib:/lib:/usr/lib -Qy
>     /home/pkgsrc/gcc49/lib/gcc/sparc-sun-solaris2.10/4.9.4/crt1.o
>     /usr/lib/crti.o /usr/ccs/lib/values-Xa.o
>     /home/pkgsrc/gcc49/lib/gcc/sparc-sun-solaris2.10/4.9.4/crtbegin.o
>     -L/export/home/pkgsrc/2017Q3/pkgsrc/bootstrap/work/wrk/sysutils/bsdinstall/work/libnbcompat
>     -L/home/pkgsrc/gcc49/lib/gcc/sparc-sun-solaris2.10/4.9.4
>     -L/home/pkgsrc/gcc49/lib/gcc/sparc-sun-solaris2.10/4.9.4/../../../../sparc-sun-solaris2.10/lib
>     -L/usr/ccs/lib
>     -L/home/pkgsrc/gcc49/lib/gcc/sparc-sun-solaris2.10/4.9.4/../../.. -rpath
>     /export/home/pkgsrc/2017Q3/lib /var/tmp//ccak8y6Q.o -lssp_nonshared -lssp
>     -lgcc -lgcc_eh -lc -lgcc -lgcc_eh -lc
>     /home/pkgsrc/gcc49/lib/gcc/sparc-sun-solaris2.10/4.9.4/crtend.o
>     /usr/lib/crtn.o
> 
>     Solaris ld has valid single character options -r -p -a -t and -h. -p and -P
>     are closely related, so possibly the error on -P could be due to the
>     actual -p.
> 
>     My first thought for a source was libtool, since it is providing platform
>     independent link options. It's configuration has a transform related to
>     rpath with a double --, but nothing for -Wl,-rpath.
> 
>     work/wrk/pkgtools/bootstrap-mk-files/work/.cwrapper/config/libtool:transform=opt:-Wl,--rpath:-Wl,-R
>     work/wrk/sysutils/bsdinstall/work/.cwrapper/config/libtool:transform=opt:-Wl,--rpath:-Wl,-R
> 
>     I'm not sure bootstrap has gotten to calling libtool yet.
> 
>     > find work -type f -exec grep -l '.-Wl,-rpath' {} \;
>     work/share/mk/bsd.prog.mk
>     <https://na01.safelinks.protection.outlook.com/?url=http%3A%2F%2Fbsd.prog.mk&data=02%7C01%7Chooper%40queensu.ca%7C8008196d348c4249fead08d54fb8bee4%7Cd61ecb3b38b142d582c4efb2838b925c%7C1%7C0%7C636502577253495879&sdata=z%2Bv4cRo0AVFcsqWrni%2F0Xate%2B5WCuakkIh1bAuFeR40%3D&reserved=0>
>     work/wrk/pkgtools/cwrappers/work/cwrappers-20170611/cleanup-cc.c
>     work/wrk/pkgtools/cwrappers/work/cwrappers-20170611/fixup-libtool.c
>     work/wrk/pkgtools/cwrappers/work/cwrappers-20170611/generic-transform-cc.c
>     work/wrk/pkgtools/cwrappers/work/cwrappers-20170611/normalise-cc.c
>     work/wrk/pkgtools/cwrappers/work/.wrapper/tmp/gen-transform
>     work/wrk/pkgtools/cwrappers/work/.wrapper/tmp/transform.sed
>     work/wrk/pkgtools/cwrappers/work/.wrapper/tmp/untransform.sed
>     work/wrk/pkgtools/cwrappers/work/.wrapper/tmp/arg-pp-main
>     work/wrk/pkgtools/cwrappers/work/.wrapper/tmp/arg-source
>     work/wrk/pkgtools/bootstrap-mk-files/work/bootstrap-mk-files-20170802/bsd.prog.mk
>     <https://na01.safelinks.protection.outlook.com/?url=http%3A%2F%2Fbsd.prog.mk&data=02%7C01%7Chooper%40queensu.ca%7C8008196d348c4249fead08d54fb8bee4%7Cd61ecb3b38b142d582c4efb2838b925c%7C1%7C0%7C636502577253495879&sdata=z%2Bv4cRo0AVFcsqWrni%2F0Xate%2B5WCuakkIh1bAuFeR40%3D&reserved=0>
>     work/wrk/pkgtools/bootstrap-mk-files/work/.destdir/export/home/pkgsrc/2017Q3/share/mk/bsd.prog.mk
>     <https://na01.safelinks.protection.outlook.com/?url=http%3A%2F%2Fbsd.prog.mk&data=02%7C01%7Chooper%40queensu.ca%7C8008196d348c4249fead08d54fb8bee4%7Cd61ecb3b38b142d582c4efb2838b925c%7C1%7C0%7C636502577253495879&sdata=z%2Bv4cRo0AVFcsqWrni%2F0Xate%2B5WCuakkIh1bAuFeR40%3D&reserved=0>
>     work/wrk/pkgtools/bootstrap-mk-files/work/.packages/bootstrap-mk-files-20170802.tgz
>     work/wrk/sysutils/bsdinstall/work/.work.log
> 
>     On last line of work/wrk/sysutils/bsdinstall/work/.work.log, which might be
>     coming out of cwrappers:
>     <.>
>     /export/home/pkgsrc/2017Q3/pkgsrc/bootstrap/work/wrk/sysutils/bsdinstall/work/.gcc/bin/gcc
>     -m32 -v -D_FORTIFY_SOURCE=2 '-D_PATH_DEVNULL=\"/dev/null\"'
>     '-DTARGET_STRIP=\"/usr/ccs/bin/strip\"' -DHAVE_NBCOMPAT_H=1
>     -I/export/home/pkgsrc/2017Q3/pkgsrc/bootstrap/work/wrk/sysutils/bsdinstall/work/libnbcompat
>     -D_FILE_OFFSET_BITS=64 -D_LARGEFILE_SOURCE
>     -L/export/home/pkgsrc/2017Q3/pkgsrc/bootstrap/work/wrk/sysutils/bsdinstall/work/libnbcompat
>     -Wl,-rpath,/export/home/pkgsrc/2017Q3/lib conftest.c -D_FORTIFY_SOURCE=2
>     -fstack-protector
>     -I/export/home/pkgsrc/2017Q3/pkgsrc/bootstrap/work/wrk/sysutils/bsdinstall/work/.buildlink/include
> 
>     It is getting quite intricate at this point, so I'm hoping someone more
>     familiar might share a tip to progress or diagnosis.
> 
>     - Andy Hooper
> 
> 



Home | Main Index | Thread Index | Old Index