pkgsrc-Bugs archive

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

Re: pkg/44735 (pkgsrc 2010Q4 Solaris 2.{8,10} lang/gcc3 build failed (libtool problem ?))

The following reply was made to PR pkg/44735; it has been noted by GNATS.

From: Wolfgang Stukenbrock <>
        Wolfgang Stukenbrock 
Subject: Re: pkg/44735 (pkgsrc 2010Q4 Solaris 2.{8,10} lang/gcc3 build failed 
(libtool problem ?))
Date: Mon, 28 Mar 2011 10:17:57 +0200

 Hi again,
 just to clarify the "main" problem again to avoid possible confusion.
 It is not /usr/pkg/bin/libtool where the wrong shell is in.
 It is a generated libtool script inside of the gcc3 tree.
 I do not track down till now how it is generated. And the problem only 
 comes up, if the last argument to install is not a directory.
 Last "my" current "final" state of mk.conf setup that now seems to 
 compile everything correctly. I know that is not 100% related to the 
 original cause of the PR, but it belongs into the same category from my 
 point of view.
 When useing sunstudio compiler most times and use gcc(3) only for 
 packages where syntax problems (or simular) occur. the following 
 "workaround" work for gcc3 and everything required for samba.
 (see some additional bug reports on "bad" sources in some packages too.)
 I introduce a new make variable to switch between the compilers: NC_PKG_GCC
 I set this in the Makefile or Makefile.common for the packages that 
 cannot be build with sunstudio for whatever resons.
 mk.conf contents for building packages in pkgsrc.
 In addition to the currently reported -G option, gcc doesn't understand
 -library=... that needs to be eliminated.
 Than "-Qoption ld -R..." need to be transformed to either -R... or 
 -Wl,-R... (I transform it to -R.... below)
 When -xar is specified we need to change the command from CC to AR and 
 eliminate any additional options that are placed there by libtool from 
 the command line (some -L.., -m64, ...)
 remark: this is no completet analyses of the options, I just fixed the 
 one that keep the sutff from compiling/installing.
 The currently available support by the wrappers that can be controlled 
 by setting some variables in the makefile is not abled to support the 
 required modification for -xar and -Qoption. The support to specify 
 additional wrapper script generation code looks imcomplete to me. but 
 perhaps I've haven't got the main point till now.
 Now the mk.conf script part for pkgsrc-builds:
 ABI=                    64
 .ifdef NC_PKG_GCC
 PKGSRC_COMPILER=        gcc
 CC=                     /usr/pkg/gcc3/bin/gcc
 CXX=                    /usr/pkg/gcc3/bin/g++
 CPP=                    /usr/pkg/gcc3/bin/cpp
 WRAPPER_TRANSFORM_CMDS+= opt:-G:-shared rm:-library=.*
 _WRAP_ARG_PP.CXX=       ${.CURDIR}/work/.wrapper/tmp/arg-pp.CXX
          ${RUN} ${MKDIR} ${.TARGET:H}
          ${RUN} ${ECHO} 'case $$arg in' 
                          >  ${.TARGET}
          ${RUN} ${ECHO} '-xar) cmd="/usr/ccs/bin/ar cru"; argmatch=yes; 
 xxx_kill_args=1'        >> ${.TARGET}
          ${RUN} ${ECHO} '# need to kill the following -o option - we 
 know that it is there ...' >> ${.TARGET}
          ${RUN} ${ECHO} '      pop_queue argbuf arg' 
                          >> ${.TARGET}
          ${RUN} ${ECHO} '      ;;' 
                          >> ${.TARGET}
          ${RUN} ${ECHO} '-Qoption) argmatch=yes' 
                          >> ${.TARGET}
          ${RUN} ${ECHO} '# need to kill the following ld argument - we 
 know that it is there ...' >> ${.TARGET}
          ${RUN} ${ECHO} '      pop_queue argbuf arg; arg=""' 
                          >> ${.TARGET}
          ${RUN} ${ECHO} '      ;;' 
                          >> ${.TARGET}
          ${RUN} ${ECHO} '-*)   if [ -n "$$xxx_kill_args" ]; then' 
                          >> ${.TARGET}
          ${RUN} ${ECHO} '# need to kill the current argument in case it 
 is the last one ...'    >> ${.TARGET}
          ${RUN} ${ECHO} '        arg=""; argmatch=yes; do_transform=no' 
                          >> ${.TARGET}
          ${RUN} ${ECHO} '      fi' 
                          >> ${.TARGET}
          ${RUN} ${ECHO} '      ;;' 
                          >> ${.TARGET}
          ${RUN} ${ECHO} 'esac' 
                          >> ${.TARGET}
 PKGSRC_COMPILER=        sunpro
 CC=                     cc
 CXX=                    CC
 CPP=                    ${CC} -E
 SUNWSPROBASE=           /opt/SUNWspro
 MACHINE_GNU_PLATFORM=   sparc64-sun-solaris2
 SPARC_TARGET_ARCH=      sparcv9
 PKG_DBDIR=              /var/db/pkg
 LOCALBASE=              /usr/pkg
 VARBASE=                /var
 PKG_TOOLS_BIN=          /usr/pkg/sbin
 PKGMANDIR=              man
 TOOLS_PLATFORM.install?=        /usr/pkg/bin/install-sh             /usr/pkg/bin/pdksh
 TOOLS_PLATFORM.ksh?=            /usr/pkg/bin/pdksh
 TOOLS_PLATFORM.awk?=            /usr/pkg/bin/nawk
 TOOLS_PLATFORM.sed?=            /usr/pkg/bin/nbsed
 # added by us to avoid possible Solaris tar incomparbilities with 
 "latest" gnutar stuff
 TOOLS_PLATFORM.tar?=            /usr/pkg/bin/bsdtar
 Perhaps something of this will find it's way into the documentation for 
 The settings for MACHINE_GNU_PLATFORM and SPARC_TARGET_ARCH should be 
 generated by the bootstrap process if ABI=64 is used. It is needed by 
 some packages in a "gcc only" setup too. And The evaluated defaults for 
 theese variables are simply wrong resulting in build errors in the packages.
 Best regards
 W. Stukenbrock
 Tim Zingelman wrote:
 > On Thu, Mar 24, 2011 at 6:00 AM, Wolfgang Stukenbrock
 > <> wrote:
 >>The following reply was made to PR pkg/44735; it has been noted by GNATS.
 >> I've " /usr/pkg/bin/pdksh" in the
 >> /usr/pkg/etc/mk.conf too. It is placed there by the bootstrap process.
 > I guess I do not understand then how your libtool comes to contain
 > SHELL=/bin/sh and mine has the correct SHELL=/usr/pkg/bin/pdksh
 >> When I switch to gcc3 for compilation, I run into problems with libtool
 >> again, because libtool was build with sunstudio and there are some
 >> imcompartible options that are hardcoded into /usr/pkg/bin/libtool ...
 >> The main problem here is, that libtool has no support (till now) for
 >> more than one compiler setup. It would be realy great improvement if
 >> libtool would support different compilers in one installation depending
 >> on "whatever" option, compiler name analyses or environment setting.
 > I think this should be fixed in the compiler specific transforms found
 > in pkgsrc/mk/wrapper/* the idea being that based on the compiler (or
 > other tool) in use, all args are converted to match what is needed.  I
 > am aware that these are currently incomplete, but have not understood
 > the entire infrastructure sufficiently yet to propose required fixes.
 >> First -G does not work with gcc, so the following line is required to
 >> fix the option:
 >> WRAPPER_TRANSFORM_CMDS+= opt:-G:-shared
 >> There are some -G<num> options for some architectures in gcc, but I hope
 >> this does not hurt - at least for me it works for now.
 >> The next problem is that sunstudio requires CC to be called with -xar to
 >> build .a files from c++ sources. G++ never heard of this ...
 >> This is more problematic, but can be worked around be the following:
 > I'm not sure I follow the complex solution you suggest, but if the
 > only requirement is to remove the -xar argument, then
 > WRAPPER_TRANSFORM_CMDS+= rm:-xar would do that for you.
 > I'm not a make expert, so perhaps someone else could better answer the
 > other questions.

Home | Main Index | Thread Index | Old Index