You are not logged in.

#1 2013-11-03 17:53:19

Renan Birck
Member
From: Brazil
Registered: 2007-11-11
Posts: 401
Website

[SOLVED] gcc-4.6 cannot find -lgcc

I am trying to get the MSP430 development toolchain (gcc-msp430, msp430-libc, msp430-binutils, msp430mcu, mspdebug) installed in a fresh Arch Linux install.

For this I need gcc46, because gcc-msp430 doesn't build with GCC 4.8. I successfully built gcc46 from AUR using the PKGBUILD from here, but it cannot compile anything, not even a Hello World program:

/tmp $ gcc-4.6 -o hello hello.c
/usr/bin/ld: cannot find -lgcc
collect2: ld returned 1 exit status

I tried the PKGBUILDs from here, which are recommended in the AUR page for gcc-msp430, but still doesn't work.

What to do?

Last edited by Renan Birck (2013-11-05 20:23:42)

Offline

#2 2013-11-03 23:07:56

Allan
Developer
From: Brisbane, AU
Registered: 2007-06-09
Posts: 10,438
Website

Re: [SOLVED] gcc-4.6 cannot find -lgcc

Add options=('!staticlibs') in the PKGBUILD.   It needs to be updated for our change in packaging policy.

Online

#3 2013-11-04 01:02:08

Renan Birck
Member
From: Brazil
Registered: 2007-11-11
Posts: 401
Website

Re: [SOLVED] gcc-4.6 cannot find -lgcc

Unfortunately, this still doesn't work: libgcc.a is not in /usr/lib/gcc/x86_64-unknown-linux-gnu/4.6.4 nor in the generated package, but it seems to be built:

~/pkgbuilds/gcc46 $ find . -iname libgcc*.a
./src/gcc-build/stage1-gcc/libgcc_eh.a
./src/gcc-build/stage1-gcc/libgcc.a
./src/gcc-build/prev-gcc/libgcc_eh.a
./src/gcc-build/prev-gcc/libgcc.a
./src/gcc-build/prev-x86_64-unknown-linux-gnu/libgcc/libgcc_eh.a
./src/gcc-build/prev-x86_64-unknown-linux-gnu/libgcc/libgcc.a
./src/gcc-build/gcc/libgcc_eh.a
./src/gcc-build/gcc/libgcc.a
./src/gcc-build/x86_64-unknown-linux-gnu/libgcc/libgcc_eh.a
./src/gcc-build/x86_64-unknown-linux-gnu/libgcc/libgcc.a
./src/gcc-build/stage1-x86_64-unknown-linux-gnu/libgcc/libgcc_eh.a
./src/gcc-build/stage1-x86_64-unknown-linux-gnu/libgcc/libgcc.a

Offline

#4 2013-11-04 02:52:59

Allan
Developer
From: Brisbane, AU
Registered: 2007-06-09
Posts: 10,438
Website

Re: [SOLVED] gcc-4.6 cannot find -lgcc

Ah - stupid error on my behalf...   Use options=('staticlibs') to keep the static library.   "makepkg -R" should just repackage this without you needing to rebuild.

Online

#5 2013-11-05 20:23:30

Renan Birck
Member
From: Brazil
Registered: 2007-11-11
Posts: 401
Website

Re: [SOLVED] gcc-4.6 cannot find -lgcc

It works! Marking as solved. Thanks!

Offline

#6 2013-11-30 23:31:44

campo85
Member
Registered: 2012-09-05
Posts: 23

Re: [SOLVED] gcc-4.6 cannot find -lgcc

Renan Birck wrote:

It works! Marking as solved. Thanks!


How did you compile gcc-msp430 ? I've tryed but it failed the ./configure of libgcc

make[2]: uscita dalla directory "/home/campo/System/Aur/gcc-msp430/src/build/gcc"
Checking multilib configuration for libgcc...
mkdir -p -- msp430/libgcc
Configuring in msp430/libgcc
configure: creating cache ./config.cache
checking for --enable-version-specific-runtime-libs... no
checking for a BSD-compatible install... /usr/bin/install -c
checking for gawk... gawk
checking build system type... i686-pc-linux-gnu
checking host system type... msp430-unknown-none
checking for msp430-ar... msp430-ar
checking for msp430-lipo... msp430-lipo
checking for msp430-nm... /home/campo/System/Aur/gcc-msp430/src/build/./gcc/nm
checking for msp430-ranlib... msp430-ranlib
checking for msp430-strip... msp430-strip
checking whether ln -s works... yes
checking for msp430-gcc... /home/campo/System/Aur/gcc-msp430/src/build/./gcc/xgcc -B/home/campo/System/Aur/gcc-msp430/src/build/./gcc/ -B/usr/msp430/bin/ -B/usr/msp430/lib/ -isystem /usr/msp430/include -isystem /usr/msp430/sys-include   
checking for suffix of object files... configure: error: in `/home/campo/System/Aur/gcc-msp430/src/build/msp430/libgcc':
configure: error: cannot compute suffix of object files: cannot compile
See `config.log' for more details.
Makefile:12255: set di istruzioni per l'obiettivo "configure-target-libgcc" non riuscito
make[1]: *** [configure-target-libgcc] Errore 1
make[1]: uscita dalla directory "/home/campo/System/Aur/gcc-msp430/src/build"
Makefile:872: set di istruzioni per l'obiettivo "all" non riuscito
make: *** [all] Errore 2
==> ERRORE: Si è verificato un errore in build().
    L'operazione sta per essere interrotta...
makepkg  454,81s user 23,85s system 93% cpu 8:34,53 total

I checked the config.log but I didn't find anything :

This file contains any messages produced by compilers while
running configure, to aid debugging if configure makes a mistake.

It was created by GNU C Runtime Library configure 1.0, which was
generated by GNU Autoconf 2.64.  Invocation command line was

  $ /home/campo/System/Aur/gcc-msp430/src/gcc-4.6.3/libgcc/configure --cache-file=./config.cache --enable-multilib --with-cross-host=i686-pc-linux-gnu --prefix=/usr --infodir=/usr/share/info --mandir=/usr/share/man --disable-libssp --disable-nls --with-gnu-as --with-gnu-ld --with-as=/usr/bin/msp430-as --with-ld=/usr/bin/msp430-ld --with-pkgversion=mspgcc_20120406 --enable-languages=c,c++,lto --program-transform-name=s&^&msp430-& --disable-option-checking --with-target-subdir=msp430 --build=i686-pc-linux-gnu --host=msp430 --target=msp430 --srcdir=/home/campo/System/Aur/gcc-msp430/src/gcc-4.6.3/libgcc

## --------- ##
## Platform. ##
## --------- ##

hostname = enterprise
uname -m = i686
uname -r = 3.12.0-1-ARCH
uname -s = Linux
uname -v = #1 SMP PREEMPT Wed Nov 6 09:22:18 CET 2013

/usr/bin/uname -p = unknown
/bin/uname -X     = unknown

/bin/arch              = unknown
/usr/bin/arch -k       = unknown
/usr/convex/getsysinfo = unknown
/usr/bin/hostinfo      = unknown
/bin/machine           = unknown
/usr/bin/oslevel       = unknown
/bin/universe          = unknown

PATH: /usr/local/sbin
PATH: /usr/local/bin
PATH: /usr/bin
PATH: /opt/android-sdk/platform-tools
PATH: /opt/android-sdk/tools
PATH: /usr/local/xenon/bin
PATH: /usr/local/xenon/usr/bin
PATH: /usr/bin/vendor_perl
PATH: /usr/bin/core_perl
PATH: /usr/local/xenon/bin
PATH: /usr/local/xenon/usr/bin
PATH: /opt/android-sdk/tools
PATH: /platform-tools


## ----------- ##
## Core tests. ##
## ----------- ##

configure:1742: creating cache ./config.cache
configure:1903: checking for --enable-version-specific-runtime-libs
configure:1916: result: no
configure:1964: checking for a BSD-compatible install
configure:2032: result: /usr/bin/install -c
configure:2048: checking for gawk
configure:2075: result: gawk
configure:2095: checking build system type
configure:2109: result: i686-pc-linux-gnu
configure:2129: checking host system type
configure:2142: result: msp430-unknown-none
configure:2245: checking for msp430-ar
configure:2272: result: msp430-ar
configure:2337: checking for msp430-lipo
configure:2364: result: msp430-lipo
configure:2429: checking for msp430-nm
configure:2456: result: /home/campo/System/Aur/gcc-msp430/src/build/./gcc/nm
configure:2521: checking for msp430-ranlib
configure:2548: result: msp430-ranlib
configure:2613: checking for msp430-strip
configure:2640: result: msp430-strip
configure:2702: checking whether ln -s works
configure:2706: result: yes
configure:2723: checking for msp430-gcc
configure:2750: result: /home/campo/System/Aur/gcc-msp430/src/build/./gcc/xgcc -B/home/campo/System/Aur/gcc-msp430/src/build/./gcc/ -B/usr/msp430/bin/ -B/usr/msp430/lib/ -isystem /usr/msp430/include -isystem /usr/msp430/sys-include   
configure:3019: checking for C compiler version
configure:3028: /home/campo/System/Aur/gcc-msp430/src/build/./gcc/xgcc -B/home/campo/System/Aur/gcc-msp430/src/build/./gcc/ -B/usr/msp430/bin/ -B/usr/msp430/lib/ -isystem /usr/msp430/include -isystem /usr/msp430/sys-include    --version >&5
xgcc (mspgcc_20120406) 4.6.3 20120301 (mspgcc LTS 20120406 unpatched)
Copyright (C) 2011 Free Software Foundation, Inc.
This is free software; see the source for copying conditions.  There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.

configure:3039: $? = 0
configure:3028: /home/campo/System/Aur/gcc-msp430/src/build/./gcc/xgcc -B/home/campo/System/Aur/gcc-msp430/src/build/./gcc/ -B/usr/msp430/bin/ -B/usr/msp430/lib/ -isystem /usr/msp430/include -isystem /usr/msp430/sys-include    -v >&5
Reading specs from /home/campo/System/Aur/gcc-msp430/src/build/./gcc/specs
Reading specs from /usr/msp430/lib/msp430mcu.spec
COLLECT_GCC=/home/campo/System/Aur/gcc-msp430/src/build/./gcc/xgcc
COLLECT_LTO_WRAPPER=/home/campo/System/Aur/gcc-msp430/src/build/./gcc/lto-wrapper
Target: msp430
Configured with: /home/campo/System/Aur/gcc-msp430/src/gcc-4.6.3/configure CFLAGS_FOR_TARGET=-Os --prefix=/usr --infodir=/usr/share/info --mandir=/usr/share/man --disable-libssp --disable-nls --target=msp430 --enable-languages=c,c++ --with-gnu-as --with-gnu-ld --with-as=/usr/bin/msp430-as --with-ld=/usr/bin/msp430-ld --with-pkgversion=mspgcc_20120406
Thread model: single
gcc version 4.6.3 20120301 (mspgcc LTS 20120406 unpatched) (mspgcc_20120406) 
configure:3039: $? = 0
configure:3028: /home/campo/System/Aur/gcc-msp430/src/build/./gcc/xgcc -B/home/campo/System/Aur/gcc-msp430/src/build/./gcc/ -B/usr/msp430/bin/ -B/usr/msp430/lib/ -isystem /usr/msp430/include -isystem /usr/msp430/sys-include    -V >&5
xgcc: fatal error: no input files
compilation terminated.
configure:3039: $? = 1
configure:3028: /home/campo/System/Aur/gcc-msp430/src/build/./gcc/xgcc -B/home/campo/System/Aur/gcc-msp430/src/build/./gcc/ -B/usr/msp430/bin/ -B/usr/msp430/lib/ -isystem /usr/msp430/include -isystem /usr/msp430/sys-include    -qversion >&5
xgcc: fatal error: no input files
compilation terminated.
configure:3039: $? = 1
configure:3055: /home/campo/System/Aur/gcc-msp430/src/build/./gcc/xgcc -B/home/campo/System/Aur/gcc-msp430/src/build/./gcc/ -B/usr/msp430/bin/ -B/usr/msp430/lib/ -isystem /usr/msp430/include -isystem /usr/msp430/sys-include    -o conftest -Os   conftest.c  >&5
Known MCU names:
	 msp1
	 msp2
	 msp430x110
	 msp430x112
	 msp430x1101
	 msp430x1111
	 msp430x1121
	 msp430x1122
	 msp430x1132
	 msp430x122
	 msp430x123
	 msp430x1222
	 msp430x1232
	 msp430x133
	 msp430x135
	 msp430x1331
	 msp430x1351
	 msp430x147
	 msp430x148
	 msp430x149
	 msp430x155
	 msp430x156
	 msp430x157
	 msp430x167
	 msp430x168
	 msp430x169
	 msp430x1610
	 msp430x1611
	 msp430x1612
	 msp430x2101
	 msp430x2111
	 msp430x2121
	 msp430x2131
	 msp430x311
	 msp430x312
	 msp430x313
	 msp430x314
	 msp430x315
	 msp430x323
	 msp430x325
	 msp430x336
	 msp430x337
	 msp430x412
	 msp430x413
	 msp430x415
	 msp430x417
	 msp430xE423
	 msp430xE425
	 msp430xE427
	 msp430xW423
	 msp430xW425
	 msp430xW427
	 msp430xG437
	 msp430xG438
	 msp430xG439
	 msp430x435
	 msp430x436
	 msp430x437
	 msp430x447
	 msp430x448
	 msp430x449

Assembler messages:
Fatal error: unknown MCU: cpu=430

configure:3058: $? = 1
configure:3246: checking for suffix of object files
configure:3268: /home/campo/System/Aur/gcc-msp430/src/build/./gcc/xgcc -B/home/campo/System/Aur/gcc-msp430/src/build/./gcc/ -B/usr/msp430/bin/ -B/usr/msp430/lib/ -isystem /usr/msp430/include -isystem /usr/msp430/sys-include    -c -Os  conftest.c >&5
Known MCU names:
	 msp1
	 msp2
	 msp430x110
	 msp430x112
	 msp430x1101
	 msp430x1111
	 msp430x1121
	 msp430x1122
	 msp430x1132
	 msp430x122
	 msp430x123
	 msp430x1222
	 msp430x1232
	 msp430x133
	 msp430x135
	 msp430x1331
	 msp430x1351
	 msp430x147
	 msp430x148
	 msp430x149
	 msp430x155
	 msp430x156
	 msp430x157
	 msp430x167
	 msp430x168
	 msp430x169
	 msp430x1610
	 msp430x1611
	 msp430x1612
	 msp430x2101
	 msp430x2111
	 msp430x2121
	 msp430x2131
	 msp430x311
	 msp430x312
	 msp430x313
	 msp430x314
	 msp430x315
	 msp430x323
	 msp430x325
	 msp430x336
	 msp430x337
	 msp430x412
	 msp430x413
	 msp430x415
	 msp430x417
	 msp430xE423
	 msp430xE425
	 msp430xE427
	 msp430xW423
	 msp430xW425
	 msp430xW427
	 msp430xG437
	 msp430xG438
	 msp430xG439
	 msp430x435
	 msp430x436
	 msp430x437
	 msp430x447
	 msp430x448
	 msp430x449

Assembler messages:
Fatal error: unknown MCU: cpu=430

configure:3272: $? = 1
configure: failed program was:
| /* confdefs.h */
| #define PACKAGE_NAME "GNU C Runtime Library"
| #define PACKAGE_TARNAME "libgcc"
| #define PACKAGE_VERSION "1.0"
| #define PACKAGE_STRING "GNU C Runtime Library 1.0"
| #define PACKAGE_BUGREPORT ""
| #define PACKAGE_URL "http://www.gnu.org/software/libgcc/"
| /* end confdefs.h.  */
| 
| int
| main ()
| {
| 
|   ;
|   return 0;
| }
configure:3286: error: in `/home/campo/System/Aur/gcc-msp430/src/build/msp430/libgcc':
configure:3289: error: cannot compute suffix of object files: cannot compile
See `config.log' for more details.

## ---------------- ##
## Cache variables. ##
## ---------------- ##

ac_cv_build=i686-pc-linux-gnu
ac_cv_env_CC_set=set
ac_cv_env_CC_value='/home/campo/System/Aur/gcc-msp430/src/build/./gcc/xgcc -B/home/campo/System/Aur/gcc-msp430/src/build/./gcc/ -B/usr/msp430/bin/ -B/usr/msp430/lib/ -isystem /usr/msp430/include -isystem /usr/msp430/sys-include   '
ac_cv_env_CFLAGS_set=set
ac_cv_env_CFLAGS_value=-Os
ac_cv_env_CPPFLAGS_set=set
ac_cv_env_CPPFLAGS_value=
ac_cv_env_CPP_set=
ac_cv_env_CPP_value=
ac_cv_env_LDFLAGS_set=set
ac_cv_env_LDFLAGS_value=
ac_cv_env_LIBS_set=
ac_cv_env_LIBS_value=
ac_cv_env_build_alias_set=set
ac_cv_env_build_alias_value=i686-pc-linux-gnu
ac_cv_env_host_alias_set=set
ac_cv_env_host_alias_value=msp430
ac_cv_env_target_alias_set=set
ac_cv_env_target_alias_value=msp430
ac_cv_host=msp430-unknown-none
ac_cv_prog_AR=msp430-ar
ac_cv_prog_AWK=gawk
ac_cv_prog_CC='/home/campo/System/Aur/gcc-msp430/src/build/./gcc/xgcc -B/home/campo/System/Aur/gcc-msp430/src/build/./gcc/ -B/usr/msp430/bin/ -B/usr/msp430/lib/ -isystem /usr/msp430/include -isystem /usr/msp430/sys-include   '
ac_cv_prog_LIPO=msp430-lipo
ac_cv_prog_NM=/home/campo/System/Aur/gcc-msp430/src/build/./gcc/nm
ac_cv_prog_RANLIB=msp430-ranlib
ac_cv_prog_STRIP=msp430-strip

## ----------------- ##
## Output variables. ##
## ----------------- ##

AR='msp430-ar'
AWK='gawk'
CC='/home/campo/System/Aur/gcc-msp430/src/build/./gcc/xgcc -B/home/campo/System/Aur/gcc-msp430/src/build/./gcc/ -B/usr/msp430/bin/ -B/usr/msp430/lib/ -isystem /usr/msp430/include -isystem /usr/msp430/sys-include   '
CFLAGS='-Os'
CPP=''
CPPFLAGS=''
DEFS=''
ECHO_C=''
ECHO_N='-n'
ECHO_T=''
EXEEXT=''
INSTALL_DATA='/usr/bin/install -c -m 644'
INSTALL_PROGRAM='/usr/bin/install -c'
INSTALL_SCRIPT='/usr/bin/install -c'
LDFLAGS=''
LIBOBJS=''
LIBS=''
LIPO='msp430-lipo'
LN_S='ln -s'
LTLIBOBJS=''
MAINT='#'
NM='/home/campo/System/Aur/gcc-msp430/src/build/./gcc/nm'
OBJEXT=''
PACKAGE_BUGREPORT=''
PACKAGE_NAME='GNU C Runtime Library'
PACKAGE_STRING='GNU C Runtime Library 1.0'
PACKAGE_TARNAME='libgcc'
PACKAGE_URL='http://www.gnu.org/software/libgcc/'
PACKAGE_VERSION='1.0'
PATH_SEPARATOR=':'
RANLIB='msp430-ranlib'
SHELL='/bin/sh'
STRIP='msp430-strip'
ac_ct_CC=''
asm_hidden_op=''
bindir='${exec_prefix}/bin'
build='i686-pc-linux-gnu'
build_alias='i686-pc-linux-gnu'
build_cpu='i686'
build_libsubdir='build-i686-pc-linux-gnu'
build_os='linux-gnu'
build_subdir='build-i686-pc-linux-gnu'
build_vendor='pc'
datadir='${datarootdir}'
datarootdir='${prefix}/share'
decimal_float=''
docdir='${datarootdir}/doc/${PACKAGE_TARNAME}'
dvidir='${docdir}'
enable_decimal_float=''
enable_shared='yes'
exec_prefix='NONE'
extra_parts=''
fixed_point=''
host='msp430-unknown-none'
host_alias='msp430'
host_cpu='msp430'
host_noncanonical='msp430'
host_os='none'
host_subdir='.'
host_vendor='unknown'
htmldir='${docdir}'
includedir='${prefix}/include'
infodir='/usr/share/info'
libdir='${exec_prefix}/lib'
libexecdir='${exec_prefix}/libexec'
libgcc_topdir='/home/campo/System/Aur/gcc-msp430/src/gcc-4.6.3/libgcc/..'
localedir='${datarootdir}/locale'
localstatedir='${prefix}/var'
mandir='/usr/share/man'
oldincludedir='/usr/include'
pdfdir='${docdir}'
prefix='/usr'
program_transform_name='s&^&msp430-&'
psdir='${docdir}'
sbindir='${exec_prefix}/sbin'
set_have_cc_tls=''
set_use_emutls=''
sharedstatedir='${prefix}/com'
slibdir='$(exec_prefix)/$(host_noncanonical)/lib'
sysconfdir='${prefix}/etc'
target_alias='msp430'
target_noncanonical='msp430'
target_subdir='msp430'
tmake_file=''
toolexecdir='$(exec_prefix)/$(target_noncanonical)'
toolexeclibdir='$(toolexecdir)/lib'
vis_hide=''

## ----------- ##
## confdefs.h. ##
## ----------- ##

/* confdefs.h */
#define PACKAGE_NAME "GNU C Runtime Library"
#define PACKAGE_TARNAME "libgcc"
#define PACKAGE_VERSION "1.0"
#define PACKAGE_STRING "GNU C Runtime Library 1.0"
#define PACKAGE_BUGREPORT ""
#define PACKAGE_URL "http://www.gnu.org/software/libgcc/"

configure: exit 1

Can you help me ?

Offline

Board footer

Powered by FluxBB