pkgsrc-Users archive

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

Re: shared libs on solars



Hello,

> I have compiled gcc into /usr/gcc. I designated this as my "system c 
> compiler" to be used for pkgsrc (and everything else).
> 
> To avoid dealing with gcc's shared libs (libgcc.so and libstdc++.so), I 
> configured gcc with --disabled-shared.
> 
> that breaks some packages such as devel/gmp. Gmp builds a shared lib and 
> wants to link libstdc++.a. Linking a non-shared lib to a shared lib doesn't 
> work.
> 
> Is there a way around that?
> 
> 
> Next try. I configured gcc with enable-shared=libstc++. Now g++ compiled 
> program's don't find libstdc++. Apparently, the pkgsrc framework does not add 
> -R /usr/gcc/lib to g++.
> 
> What is the cleanest solution for this in the pkgsrc framework?

I decided to add
CXXFLAGS=  -Wl,-R/usr/gcc/lib
to mk.conf. Gmp's configure script bails out:

checking C++ compiler g++  -mcpu=ultrasparc -mtune=v9 -O2 -pipe 
-Wl,-R/usr/gcc/lib... no, program does not run
configure: error: C++ compiler not available, see config.log for details


From config.log:

CXXFLAGS chosen by autoconf: -mcpu=ultrasparc -mtune=v9 -O2 -pipe 
-Wl,-R/usr/gcc/lib
configure:10051: checking C++ compiler g++  -mcpu=ultrasparc -mtune=v9 -O2 
-pipe -Wl,-R/usr/gcc/lib
Test compile: 
configure:10065: g++  -mcpu=ultrasparc -mtune=v9 -O2 -pipe -Wl,-R/usr/gcc/lib 
conftest.cc >&5
configure:10068: $? = 0
configure:10072: ./a.out || ./b.out || ./a.exe || ./a_out.exe || ./conftest
ld.so.1: a.out: fatal: libstdc++.so.6: open failed: No such file or directory
Killed 
./configure: ./b.out: not found
./configure: ./a.exe: not found
./configure: ./a_out.exe: not found
./configure: ./conftest: not found
configure:10075: $? = 127
failed program was:

int main (void) { return 0; }


I can compile and run this program by hand with the above g++ command. Somehow, 
pkgsrc is adding a lot of variables to my environment breaking my intention. 
Bmake PKG_DEBUG_LEVEL=1 configure shows:


/usr/bin/env INSTALL=/usr/local/bin/install-sh\ -c\ -o\ root\ -g\ root 
INSTALL_PROGRAM=/usr/local/bin/install-sh\ -c\ -s\ -o\ root\ -g\ root\ -m\ 555 
INSTALL_SCRIPT=/usr/local/bin/install-sh\ -c\ -o\ root\ -g\ root\ -m\ 555 
INSTALL_DATA=/usr/local/bin/install-sh\ -c\ -o\ root\ -g\ root\ -m\ 444 
INSTALL_GAME=/usr/local/bin/install-sh\ -c\ -s\ -o\ games\ -g\ games\ -m\ 2555 
INSTALL_GAME_DATA=/usr/local/bin/install-sh\ -c\ -o\ games\ -g\ games\ -m\ 664 
LIBTOOL="libtool " 
INSTALL_INFO=/tmp/pkgsrc/devel/gmp/work/.tools/bin/install-info 
MAKEINFO=/tmp/pkgsrc/devel/gmp/work/.tools/bin/makeinfo AWK=/usr/local/bin/nawk 
CAT=/usr/bin/cat ac_cv_path_CAT=/usr/bin/cat CHMOD=/usr/bin/chmod CMP=/bin/cmp 
CP=/bin/cp DIFF=/bin/diff ECHO=echo ac_cv_path_ECHO=echo 
EGREP=/usr/xpg4/bin/grep\ -E ac_cv_path_EGREP=/usr/xpg4/bin/grep\ -E 
SETENV=/usr/bin/env ENV_PROG=/usr/bin/env ac_cv_path_ENV=/usr/bin/env 
FALSE=false ac_cv_path_FALSE=false FIND=/usr/bin/find M4=/usr/local/bin/gm4 
GREP=/usr/xpg4/bin/gre
 p ac_cv_path_GREP=/usr/xpg4/bin/grep HOSTNAME=/bin/hostname LN=/usr/bin/ln 
LS=/usr/bin/ls MKDIR=/usr/bin/mkdir\ -p MV=/usr/bin/mv RM=/usr/bin/rm 
RMDIR=/usr/bin/rmdir SED=/usr/local/bin/nbsed SORT=/usr/bin/sort 
TAR=/usr/local/bin/tar TEST=test ac_cv_path_TEST=test TOUCH=/usr/bin/touch 
TR=/usr/bin/tr TRUE=true ac_cv_path_TRUE=true PKG_CONFIG= 
PKG_CONFIG_LIBDIR=/tmp/pkgsrc/devel/gmp/work/.buildlink/lib/pkgconfig:/tmp/pkgsrc/devel/gmp/work/.buildlink/share/pkgconfig
 PKG_CONFIG_LOG=/tmp/pkgsrc/devel/gmp/work/.pkg-config.log PKG_CONFIG_PATH= 
MAKE=make WRAPPER_DEBUG=no WRAPPER_UPDATE_CACHE=yes CC=gcc 
CFLAGS=-mcpu=ultrasparc\ -mtune=v9\ -O2\ -pipe CPPFLAGS= CXX=g++ 
CXXFLAGS=-mcpu=ultrasparc\ -mtune=v9\ -O2\ -pipe\ -Wl,-R/usr/gcc/lib 
COMPILER_RPATH_FLAG=-Wl,-R F77=f77 FC=f77 FFLAGS=-O LANG=C LC_COLLATE=C 
LC_CTYPE=C LC_MESSAGES=C LC_MONETARY=C LC_NUMERIC=C LC_TIME=C 
LDFLAGS=-Wl,-R/usr/local/lib LINKER_RPATH_FLAG=-R 
PATH=/tmp/pkgsrc/devel/gmp/work/.wrapper/bin:/tmp/pkgsrc/devel/gmp/wor
 
k/.buildlink/bin:/tmp/pkgsrc/devel/gmp/work/.gcc/bin:/tmp/pkgsrc/devel/gmp/work/.tools/bin:/usr/local/bin:/usr/gcc/bin:/usr/bin:/usr/xpg4/bin:/usr/ccs/bin:/usr/ucb:/usr/local/bin:/usr/local/sbin:/usr/sfw/bin:/usr/sfw/sbin:/opt/sfw/bin:/opt/sfw/sbin:/root/bin:/usr/local/bin:/usr/openwin/bin
 PREFIX=/usr/local PKG_SYSCONFDIR=/usr/local/etc 
HOME=/tmp/pkgsrc/devel/gmp/work/.home CONFIG_SHELL=/usr/local/bin/pdksh LIBS= 
ac_given_INSTALL=/usr/local/bin/install-sh\ -c\ -o\ root\ -g\ root              
               /usr/local/bin/pdksh                    ./configure 
--without-readline --enable-cxx --prefix=/usr/local --build=sparc-sun-solaris2 
--host=sparc-sun-solaris2 --infodir=/usr/local/info --mandir=/usr/local/man

I don't know where it breaks.

 Stefan


-- 

Scotty: Captain, we din' can reference it!
Kirk:   Analysis, Mr. Spock?
Spock:  Captain, it doesn't appear in the symbol table.
Kirk:   Then it's of external origin?
Spock:  Affirmative.
Kirk:   Mr. Sulu, go to pass two.
Sulu:   Aye aye, sir, going to pass two.


Home | Main Index | Thread Index | Old Index