Could my understanding of 'crti.o' in a ARM cross compile be verified?

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

 



For such a tiny little piece of code, "crti.o" certainly has
it's share of google traffic.

I've been chasing this error:
     "/opt/arm-tools/arm-linux/bin/ld: crti.o: No such file: No such
file or directory"
off and on now for a couple of months.

After invoking 'strace' on the top level make file, it appears
as though 'xgcc' is calling the cross linker 'ld' with 'crti.o'
as an one of its arguments.  The command is performed from
within the '$BUILD_DIR/gcc' directory, where I see lots of
'crt*.o' object files, but no  'crti.o'.

I can see there are many source files that are in the gcc source
tree that could potentially be assembled/compiled into a 'crti.o'
(not the least of which is '$SRC_DIR/gcc/config/arm/crti.asm')

My first assumption is that since the cross linker is called,
advice along the lines of "You need to install glibc-dev libraries"
*won't* help.  _Is this true_?

My second assumption is that I've somehow configured gcc to avoid
building 'crti.o' in the ./gcc directory, and I need to get the
configure script to want to build this. _Is this true_?

I've tried this with three versions (4.0.4, 4.4.4, 4.5.0) and
the results are the same.

My configure line is:
    # ../../src/gcc-4.5.0/configure --target=arm-linux
--prefix=/opt/arm-tools --disable-threads --enable-languages=c
    checking build system type... x86_64-unknown-linux-gnu
    checking host system type... x86_64-unknown-linux-gnu
    checking target system type... arm-unknown-linux-gnu
    ...

The resulting error is:
============ Start

# @multilib_dir@ is not really necessary, but sometimes it has
# more uses than just a directory name.
/bin/bash ../../../../src/gcc-4.5.0/libgcc/../mkinstalldirs .
/home/dimple/x-tools/build/gcc-4.5.0/./gcc/xgcc
-B/home/dimple/x-tools/build/gcc-4.5.0/./gcc/
-B/opt/arm-tools/arm-linux/bin/ -B/opt/arm-tools/arm-linux/lib/
-isystem /opt/arm-tools/arm-linux/include -isystem
/opt/arm-tools/arm-linux/sys-include    -O2  -g -O2 -DIN_GCC
-DCROSS_DIRECTORY_STRUCTURE  -W -Wall -Wwrite-strings -Wcast-qual
-Wstrict-prototypes -Wmissing-prototypes -Wold-style-definition
-isystem ./include  -fomit-frame-pointer -fPIC -Wno-missing-prototypes
-g  -DIN_LIBGCC2 -D__GCC_FLOAT_NOT_NEEDED -Dinhibit_libc -shared
-nodefaultlibs -Wl,--soname=libgcc_s.so.1
-Wl,--version-script=libgcc.map -o ./libgcc_s.so.1.tmp -g -O2 -B./
_udivsi3_s.o _divsi3_s.o _umodsi3_s.o _modsi3_s.o _dvmd_lnx_s.o
_clzsi2_s.o _clzdi2_s.o _arm_addsubdf3_s.o _arm_addsubsf3_s.o
_muldi3_s.o _negdi2_s.o _lshrdi3_s.o _ashldi3_s.o _ashrdi3_s.o
_cmpdi2_s.o _ucmpdi2_s.o _clear_cache_s.o _enable_execute_stack_s.o
_trampoline_s.o __main_s.o _absvsi2_s.o _absvdi2_s.o _addvsi3_s.o
_addvdi3_s.o _subvsi3_s.o _subvdi3_s.o _mulvsi3_s.o _mulvdi3_s.o
_negvsi2_s.o _negvdi2_s.o _ctors_s.o _ffssi2_s.o _ffsdi2_s.o _clz_s.o
_ctzsi2_s.o _ctzdi2_s.o _popcount_tab_s.o _popcountsi2_s.o
_popcountdi2_s.o _paritysi2_s.o _paritydi2_s.o _powisf2_s.o
_powidf2_s.o _powixf2_s.o _powitf2_s.o _mulsc3_s.o _muldc3_s.o
_mulxc3_s.o _multc3_s.o _divsc3_s.o _divdc3_s.o _divxc3_s.o
_divtc3_s.o _bswapsi2_s.o _bswapdi2_s.o _fixunssfsi_s.o
_fixunsdfsi_s.o _fixunsxfsi_s.o _fixsfdi_s.o _fixdfdi_s.o _fixxfdi_s.o
_fixtfdi_s.o _fixunssfdi_s.o _fixunsdfdi_s.o _fixunsxfdi_s.o
_fixunstfdi_s.o _floatdisf_s.o _floatdidf_s.o _floatdixf_s.o
_floatditf_s.o _floatundisf_s.o _floatundidf_s.o _floatundixf_s.o
_floatunditf_s.o _divdi3_s.o _moddi3_s.o _udivdi3_s.o _umoddi3_s.o
_udiv_w_sdiv_s.o _udivmoddi4_s.o addsf3_s.o divsf3_s.o eqsf2_s.o
gesf2_s.o lesf2_s.o mulsf3_s.o negsf2_s.o subsf3_s.o unordsf2_s.o
fixsfsi_s.o floatsisf_s.o floatunsisf_s.o adddf3_s.o divdf3_s.o
eqdf2_s.o gedf2_s.o ledf2_s.o muldf3_s.o negdf2_s.o subdf3_s.o
unorddf2_s.o fixdfsi_s.o floatsidf_s.o floatunsidf_s.o extendsfdf2_s.o
truncdfsf2_s.o unwind-dw2_s.o unwind-dw2-fde-glibc_s.o unwind-sjlj_s.o
gthr-gnat_s.o unwind-c_s.o emutls_s.o -lc && rm -f ./libgcc_s.so && if
[ -f ./libgcc_s.so.1 ]; then mv -f ./libgcc_s.so.1
./libgcc_s.so.1.backup; else true; fi && mv ./libgcc_s.so.1.tmp
./libgcc_s.so.1 && ln -s libgcc_s.so.1 ./libgcc_s.so
/opt/arm-tools/arm-linux/bin/ld: crti.o: No such file: No such file or directory
collect2: ld returned 1 exit status
make[2]: *** [libgcc_s.so] Error 1
make[2]: Leaving directory
`/home/dimple/x-tools/build/gcc-4.5.0/arm-linux/libgcc'
make[1]: *** [all-target-libgcc] Error 2
make[1]: Leaving directory `/home/dimple/x-tools/build/gcc-4.5.0'
make: *** [all] Error 2

------------ Stop


and the strace log is:
============ Start

30919 execve("/opt/arm-tools/arm-linux/bin/ld",
["/opt/arm-tools/arm-linux/bin/ld", "--eh-frame-hdr", "-shared",
"-dynamic-linker", "/lib/ld-linux.so.2", "-X", "-m", "armelf_linux",
"-p", "-o", "./libgcc_s.so.1.tmp", "crti.o",
"/home/dimple/x-tools/build/gcc-4"...,
"-L/home/dimple/x-tools/build/gcc"...,
"-L/opt/arm-tools/arm-linux/bin", "-L/opt/arm-tools/arm-linux/lib",
"-L.", "--soname=libgcc_s.so.1", "--version-script=libgcc.map",
"_udivsi3_s.o", "_divsi3_s.o", "_umodsi3_s.o", "_modsi3_s.o",
"_dvmd_lnx_s.o", "_clzsi2_s.o", "_clzdi2_s.o", "_arm_addsubdf3_s.o",
"_arm_addsubsf3_s.o", "_muldi3_s.o", "_negdi2_s.o", "_lshrdi3_s.o",
"_ashldi3_s.o", "_ashrdi3_s.o", "_cmpdi2_s.o", "_ucmpdi2_s.o",
"_clear_cache_s.o", "_enable_execute_stack_s.o", "_trampoline_s.o",
"__main_s.o", "_absvsi2_s.o", "_absvdi2_s.o", "_addvsi3_s.o",
"_addvdi3_s.o", "_subvsi3_s.o", "_subvdi3_s.o", "_mulvsi3_s.o",
"_mulvdi3_s.o", "_negvsi2_s.o", "_negvdi2_s.o", "_ctors_s.o",
"_ffssi2_s.o", "_ffsdi2_s.o", "_clz_s.o", "_ctzsi2_s.o",
"_ctzdi2_s.o", "_popcount_tab_s.o", "_popcountsi2_s.o",
"_popcountdi2_s.o", "_paritysi2_s.o", "_paritydi2_s.o",
"_powisf2_s.o", "_powidf2_s.o", "_powixf2_s.o", "_powitf2_s.o",
"_mulsc3_s.o", "_muldc3_s.o", "_mulxc3_s.o", "_multc3_s.o",
"_divsc3_s.o", "_divdc3_s.o", "_divxc3_s.o", "_divtc3_s.o",
"_bswapsi2_s.o", "_bswapdi2_s.o", "_fixunssfsi_s.o",
"_fixunsdfsi_s.o", "_fixunsxfsi_s.o", "_fixsfdi_s.o", "_fixdfdi_s.o",
"_fixxfdi_s.o", "_fixtfdi_s.o", "_fixunssfdi_s.o", "_fixunsdfdi_s.o",
"_fixunsxfdi_s.o", "_fixunstfdi_s.o", "_floatdisf_s.o",
"_floatdidf_s.o", "_floatdixf_s.o", "_floatditf_s.o",
"_floatundisf_s.o", "_floatundidf_s.o", "_floatundixf_s.o",
"_floatunditf_s.o", "_divdi3_s.o", "_moddi3_s.o", "_udivdi3_s.o",
"_umoddi3_s.o", "_udiv_w_sdiv_s.o", "_udivmoddi4_s.o", "addsf3_s.o",
"divsf3_s.o", "eqsf2_s.o", "gesf2_s.o", "lesf2_s.o", "mulsf3_s.o",
"negsf2_s.o", "subsf3_s.o", "unordsf2_s.o", "fixsfsi_s.o",
"floatsisf_s.o", "floatunsisf_s.o", "adddf3_s.o", "divdf3_s.o",
"eqdf2_s.o", "gedf2_s.o", "ledf2_s.o", "muldf3_s.o", "negdf2_s.o",
"subdf3_s.o", "unorddf2_s.o", "fixdfsi_s.o", "floatsidf_s.o",
"floatunsidf_s.o", "extendsfdf2_s.o", "truncdfsf2_s.o",
"unwind-dw2_s.o", "unwind-dw2-fde-glibc_s.o", "unwind-sjlj_s.o",
"gthr-gnat_s.o", "unwind-c_s.o", "emutls_s.o", "-lc",
"/home/dimple/x-tools/build/gcc-4"..., "crtn.o"],
["LIBRARY_PATH=/home/dimple/x-tool"..., "target_alias=arm-linux",
"WINDRES_FOR_TARGET=arm-linux-win"..., "LESSOPEN=| /usr/bin/lesspipe
%s", "mandir=/opt/arm-tools/share/man",
"GCJ_FOR_TARGET=arm-linux-gcj", "EXPECT=expect", "CFLAGS_FOR_TARGET=-g
-O2", "htmldir=/opt/arm-tools/share/doc"..., "USER=dimple",
"SSH_CLIENT=192.168.20.182 3365 2"..., "MAIL=/var/mail/dimple",
"GNATBIND=no", "CXXFLAGS=-g -O2 -D_GNU_SOURCE", "LIPO=arm-linux-lipo",
"COMPILER_PATH=/home/dimple/x-too"..., "GNATMAKE=no",
"RUNTEST=runtest", "INSTALL_SCRIPT=/usr/bin/install "...,
"s=/home/dimple/x-tools/src/gcc-4"..., "SHLVL=4",
"CPPFLAGS_FOR_TARGET=", "LD_LIBRARY_PATH=",
"COLLECT_GCC_OPTIONS='-B/home/dim"..., "HOME=/home/dimple",
"LEX=flex", "CC_FOR_BUILD=gcc", "DLLTOOL_FOR_TARGET=arm-linux-dll"...,
"docdir=/opt/arm-tools/share/doc/",
"AR_EXTRACT_FOR_TARGET=/opt/arm-t"..., "STAGEfeedback_TFLAGS=",
"pdfdir=/opt/arm-tools/share/doc/", "SSH_TTY=/dev/pts/1",
"sysconfdir=/opt/arm-tools/etc", "BUILD_CONFIG=",
"CXX_FOR_TARGET=arm-linux-c++", "tooldir=/opt/arm-tools/arm-linux",
"XFOO=", "infodir=/opt/arm-tools/share/inf"..., "AR_FLAGS=rc",
"LIBCFLAGS_FOR_TARGET=-g -O2", "WINDMC=arm-linux-windmc",
"includedir=/opt/arm-tools/includ"..., "LDFLAGS=",
"libexecdir=/opt/arm-tools/libexe"..., "STAGEfeedback_CXXFLAGS=-g
-O2", "GFORTRAN_FOR_TARGET=arm-linux-gf"..., "ADA_CFLAGS=",
"STAGE1_LANGUAGES=c", "slibdir=/opt/arm-tools/arm-linux"...,
"LIBCXXFLAGS=-g -O2 -D_GNU_SOURCE"..., "TARGET_SUBDIR=arm-linux",
"MAKEFLAGS=w -- XGCC_FLAGS_FOR_TA"..., "INCLUDES=-I. -I. -I../.././gcc
-"..., "datarootdir=/opt/arm-tools/share",
"INSTALL_DATA=/usr/bin/install -c"...,
"LD_FOR_TARGET=/opt/arm-tools/arm"..., "sbindir=/opt/arm-tools/sbin",
"COLLECT_NO_DEMANGLE=", "STRIP=/opt/arm-tools/arm-linux/b"...,
"STAGE1_CFLAGS=-g -fkeep-inline-f"..., "LOGNAME=dimple",
"RANLIB_FOR_TARGET=/opt/arm-tools"..., "STAGE2_CFLAGS=-g -O2",
"CC_FOR_TARGET=/home/dimple/x-too"..., "STAGEprofile_CFLAGS=-g -O2
-fpro"..., "_=/home/dimple/x-tools/build/gcc"..., "DESTDIR=",
"STAGE3_CFLAGS=-g -O2", "bindir=/opt/arm-tools/bin",
"exec_prefix=/opt/arm-tools", "STAGE4_CFLAGS=-g -O2",
"NM_FOR_TARGET=/opt/arm-tools/arm"...,
"OBJDUMP_FOR_TARGET=/opt/arm-tool"...,
"AR=/opt/arm-tools/arm-linux/bin/"...,
"COLLECT_GCC=/home/dimple/x-tools"..., "BOOT_LDFLAGS=",
"LDFLAGS_FOR_BUILD=", "libdir=/opt/arm-tools/lib", "TERM=xterm",
"AS=/home/dimple/x-tools/build/gc"..., "RUNTESTFLAGS=",
"BOOT_CFLAGS=-g -O2", "FLEX=flex", "AWK=gawk",
"sharedstatedir=/opt/arm-tools/co"...,
"AR_CREATE_FOR_TARGET=/opt/arm-to"...,
"LIPO_FOR_TARGET=arm-linux-lipo",
"FLAGS_FOR_TARGET=-B/opt/arm-tool"..., "CXXFLAGS_FOR_TARGET=-g -O2
-D_GN"..., "WINDRES=arm-linux-windres",
"PATH=/opt/arm-tools/bin:/usr/loc"..., "LEAN=false",
"GCJ=arm-linux-gcj -B/opt/arm-too"..., "CFLAGS=-g -O2", "MAKELEVEL=3",
"MACHMODE_H=machmode.h mode-class"...,
"GCC_EXEC_PREFIX=/home/dimple/x-t"..., "LANG=en_CA.UTF-8",
"MAKEINFO=makeinfo --split-size=5"...,
"LS_COLORS=rs=0:di=01;34:ln=01;36"...,
"MAKEOVERRIDES=${-*-command-varia"..., "TARGET_CONFIGDIRS=libgcc
libiber"..., "INSTALL=/usr/bin/install -c",
"LIB1ASMSRC=arm/lib1funcs.asm", "CPPFLAGS=",
"WINDMC_FOR_TARGET=arm-linux-wind"...,
"r=/home/dimple/x-tools/build/gcc"..., "DLLTOOL=arm-linux-dlltool",
"LDFLAGS_FOR_TARGET=", "AR_FLAGS_FOR_TARGET=", "SHELL=/bin/bash",
"SED=/bin/sed", "prefix=/opt/arm-tools", "CXX=arm-linux-c++
-B/opt/arm-too"..., "datadir=/opt/arm-tools/share",
"COLLECT_LTO_WRAPPER=/home/dimple"..., "LESSCLOSE=/usr/bin/lesspipe %s
%"..., "LIBGCC2_CFLAGS=-O2  -g -O2 -DIN_"...,
"LIBCXXFLAGS_FOR_TARGET=-g -O2 -D"..., "STAGEfeedback_CFLAGS=-g -O2
-fpr"..., "LIBCFLAGS=-g -O2", "lispdir=", "BISON=bison",
"CONFIG_SHELL=/bin/bash", "STAGE1_TFLAGS=",
"build_tooldir=/opt/arm-tools/arm"..., "CFLAGS_FOR_BUILD=-g -O2",
"GFORTRAN=arm-linux-gfortran -B/o"...,
"STRIP_FOR_TARGET=/opt/arm-tools/"..., "STAGE2_TFLAGS=",
"GCC_FOR_TARGET=/home/dimple/x-to"..., "RPATH_ENVVAR=LD_LIBRARY_PATH",
"PWD=/home/dimple/x-tools/build/g"...,
"INSTALL_PROGRAM=/usr/bin/install"..., "BOOT_ADAFLAGS=-gnatpg -gnata",
"STAGE3_TFLAGS=", "STAGEprofile_TFLAGS=",
"SSH_CONNECTION=192.168.20.182 33"..., "STAGE1_CXXFLAGS=-g -O2",
"oldincludedir=/usr/include", "localstatedir=/opt/arm-tools/var",
"LD=/home/dimple/x-tools/build/gc"..., "STAGE4_TFLAGS=",
"XGCC_FLAGS_FOR_TARGET=-B/opt/arm"..., "STAGE2_CXXFLAGS=-g -O2",
"AR_FOR_TARGET=/opt/arm-tools/arm"..., "YACC=bison -y", "M4=m4",
"CC=/home/dimple/x-tools/build/gc"...,
"AS_FOR_TARGET=/opt/arm-tools/arm"...,
"RANLIB=/opt/arm-tools/arm-linux/"..., "STAGE3_CXXFLAGS=-g -O2",
"MAKE=make", "STAGEprofile_CXXFLAGS=-g -O2", "MFLAGS=-w",
"libsubdir=/opt/arm-tools/lib/gcc"...,
"STAGE1_CHECKING=--enable-checkin"..., "CXX_FOR_BUILD=g++",
"STAGE4_CXXFLAGS=-g -O2", "OBJDUMP=/opt/arm-tools/arm-linux"...,
"TFLAGS=", "NM=/home/dimple/x-tools/build/gc"...]) = 0
30919 open("/etc/ld.so.cache", O_RDONLY) = 3
30919 open("/lib/libc.so.6", O_RDONLY)  = 3
30919 open("libgcc.map", O_RDONLY)      = 3
30919 open("./libgcc_s.so.1.tmp", O_RDWR|O_CREAT|O_TRUNC, 0666) = 4
30919 open("crti.o", O_RDONLY)          = -1 ENOENT (No such file or directory)
30918 --- SIGCHLD (Child exited) @ 0 (0) ---
30918 open("/tmp/ccfeDdM6.ld", O_RDONLY) = 3
30918 open("/tmp/ccpyZ5mO.le", O_RDONLY) = 3
30918 open("/tmp/ccfeDdM6.ld", O_RDONLY) = -1 ENOENT (No such file or directory)
30918 open("/tmp/ccpyZ5mO.le", O_RDONLY) = -1 ENOENT (No such file or directory)
30917 --- SIGCHLD (Child exited) @ 0 (0) ---
30916 --- SIGCHLD (Child exited) @ 0 (0) ---
30883 --- SIGCHLD (Child exited) @ 0 (0) ---
30873 --- SIGCHLD (Child exited) @ 0 (0) ---
30867 --- SIGCHLD (Child exited) @ 0 (0) ---
30492 --- SIGCHLD (Child exited) @ 0 (0) ---
30480 --- SIGCHLD (Child exited) @ 0 (0) ---
30478 --- SIGCHLD (Child exited) @ 0 (0) ---
30478 open("/usr/share/locale/en_CA.UTF-8/LC_MESSAGES/make.mo",
O_RDONLY) = -1 ENOENT (No such file or directory)
30478 open("/usr/share/locale/en_CA.utf8/LC_MESSAGES/make.mo",
O_RDONLY) = -1 ENOENT (No such file or directory)
30478 open("/usr/share/locale/en_CA/LC_MESSAGES/make.mo", O_RDONLY) =
-1 ENOENT (No such file or directory)
30478 open("/usr/share/locale/en.UTF-8/LC_MESSAGES/make.mo", O_RDONLY)
= -1 ENOENT (No such file or directory)
30478 open("/usr/share/locale/en.utf8/LC_MESSAGES/make.mo", O_RDONLY)
= -1 ENOENT (No such file or directory)
30478 open("/usr/share/locale/en/LC_MESSAGES/make.mo", O_RDONLY) = -1
ENOENT (No such file or directory)
30478 open("/usr/share/locale-langpack/en_CA.UTF-8/LC_MESSAGES/make.mo",
O_RDONLY) = -1 ENOENT (No such file or directory)
30478 open("/usr/share/locale-langpack/en_CA.utf8/LC_MESSAGES/make.mo",
O_RDONLY) = -1 ENOENT (No such file or directory)
30478 open("/usr/share/locale-langpack/en_CA/LC_MESSAGES/make.mo",
O_RDONLY) = -1 ENOENT (No such file or directory)
30478 open("/usr/share/locale-langpack/en.UTF-8/LC_MESSAGES/make.mo",
O_RDONLY) = -1 ENOENT (No such file or directory)
30478 open("/usr/share/locale-langpack/en.utf8/LC_MESSAGES/make.mo",
O_RDONLY) = -1 ENOENT (No such file or directory)
30478 open("/usr/share/locale-langpack/en/LC_MESSAGES/make.mo",
O_RDONLY) = -1 ENOENT (No such file or directory)

------------ Stop

- Jamie


[Index of Archives]     [Linux C Programming]     [Linux Kernel]     [eCos]     [Fedora Development]     [Fedora Announce]     [Autoconf]     [The DWARVES Debugging Tools]     [Yosemite Campsites]     [Yosemite News]     [Linux GCC]

  Powered by Linux