configure: error: cannot compute suffix of object files: cannot compile

180 Views Asked by At

I am trying to compile a compiler for ARM targets using as base following link:

https://gitlab.archlinux.org/archlinux/packaging/packages/arm-none-eabi-gcc/-/blob/main/PKGBUILD?ref_type=heads

I have installed the dependencies following the site:

https://gcc.gnu.org/install/prerequisites.html

gmp-6.2.1 mpfr-4.1.0 mpc-1.2.1 isl-0.24

but I have these errors, Please help

configure error: cannot compute suffix of object files: cannot compile

make[3]: Leaving directory '/home/users/truiz/projects/rtos_compiler/build/libcc1'
make[2]: Leaving directory '/home/users/truiz/projects/rtos_compiler/build/libcc1'
Checking multilib configuration for libgcc...
mkdir -p -- arm-none-eabi/libgcc
Configuring in arm-none-eabi/libgcc
configure: creating cache ./config.cache
checking build system type... x86_64-pc-linux-gnu
checking host system type... arm-none-eabi
checking for --enable-version-specific-runtime-libs... no
checking for a BSD-compatible install... /usr/bin/install -c
checking for gawk... gawk
checking for arm-none-eabi-ar... arm-none-eabi-ar
checking for arm-none-eabi-lipo... arm-none-eabi-lipo
checking for arm-none-eabi-nm... /home/users/truiz/projects/rtos_compiler/build/./gcc/nm
checking for arm-none-eabi-ranlib... arm-none-eabi-ranlib
checking for arm-none-eabi-strip... arm-none-eabi-strip
checking whether ln -s works... yes
checking for arm-none-eabi-gcc... /home/users/truiz/projects/rtos_compiler/build/./gcc/xgcc -B/home/users/truiz/projects/rtos_compiler/build/./gcc/ -B/arm-none-eabi/bin/ -B/arm-none-eabi/lib/ -isystem /arm-none-eabi/include -isystem /arm-none-eabi/sys-include   
checking for suffix of object files... configure: error: in `/home/users/truiz/projects/rtos_compiler/build/arm-none-eabi/libgcc':
configure: error: cannot compute suffix of object files: cannot compile
See `config.log' for more details
make[1]: *** [Makefile:13195: configure-target-libgcc] Error 1
make[1]: Leaving directory '/home/users/truiz/projects/rtos_compiler/build'
make: *** [Makefile:1035: all] Error 2

CFLAGS=${CFLAGS/-Werror=format-security/}
CXXFLAGS=${CXXFLAGS/-Werror=format-security/}

export CFLAGS_FOR_TARGET='-g -Os -ffunction-sections -fdata-sections'
export CXXFLAGS_FOR_TARGET='-g -Os -ffunction-sections -fdata-sections'

export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/usr/local/gmp/lib
export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/usr/local/mpfr/lib
export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/usr/local/mpc/lib
export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/usr/local/isl/lib

_target=arm-none-eabi

../gcc/configure \
    --target=$_target \
    --prefix= \
    --with-sysroot=/$_target \
    --with-native-system-header-dir=/include \
    --libexecdir=/usr/lib \
    --enable-languages=c,c++ \
    --enable-plugins \
    --disable-decimal-float \
    --disable-libffi \
    --disable-libgomp \
    --disable-libmudflap \
    --disable-libquadmath \
    --disable-libssp \
    --disable-libstdcxx-pch \
    --disable-nls \
    --disable-shared \
    --disable-threads \
    --disable-tls \
    --with-gnu-as \
    --with-gnu-ld \
    --with-system-zlib \
    --with-newlib \
    --with-headers=/$_target/include \
    --with-python-dir=share/gcc-arm-none-eabi \
    --with-gmp=/usr/local/gmp \
    --with-mpfr=/usr/local/mpfr \
    --with-mpc=/usr/local/mpc \
    --with-isl=/usr/local/isl \
    --with-libelf \
    --enable-gnu-indirect-function \
    --with-host-libstdcxx='-static-libgcc -Wl,-Bstatic,-lstdc++,-Bdynamic -lm' \
    --with-pkgversion='Arch Repository' \
    --with-bugurl='https://bugs.archlinux.org/' \
    --with-multilib-list=rmprofile


make INHIBIT_LIBC_CFLAGS='-DUSE_TM_CLONE_REGISTRY=0'
here the log file

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.69.  Invocation command line was

  $ /home/users/truiz/projects/rtos_compiler/gcc/libgcc/configure --srcdir=../../../gcc/libgcc --cache-file=./config.cache --enable-multilib --with-cross-host=x86_64-pc-linux-gnu --prefix= --with-sysroot=/arm-none-eabi --with-native-system-header-dir=/include --libexecdir=/usr/lib --enable-plugins --disable-decimal-float --disable-libffi --disable-libgomp --disable-libmudflap --disable-libquadmath --disable-libssp --disable-libstdcxx-pch --disable-nls --disable-shared --disable-threads --disable-tls --with-gnu-as --with-gnu-ld --with-system-zlib --with-newlib --with-headers=/arm-none-eabi/include --with-python-dir=share/gcc-arm-none-eabi --with-libelf --enable-gnu-indirect-function --with-host-libstdcxx=-static-libgcc -Wl,-Bstatic,-lstdc++,-Bdynamic -lm --with-pkgversion=Arch Repository --with-bugurl=https://bugs.archlinux.org/ --with-multilib-list=rmprofile --enable-languages=c,c++,lto --program-transform-name=s&^&arm-none-eabi-& --disable-option-checking --with-target-subdir=arm-none-eabi --build=x86_64-pc-linux-gnu --host=arm-none-eabi --target=arm-none-eabi

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

hostname = ultron
uname -m = x86_64
uname -r = 5.15.0-86-generic
uname -s = Linux
uname -v = #96-Ubuntu SMP Wed Sep 20 08:23:49 UTC 2023

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

/bin/arch              = x86_64
/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/sbin
PATH: /usr/bin
PATH: /sbin
PATH: /bin
PATH: /usr/games
PATH: /usr/local/games
PATH: /snap/bin


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

configure:2083: creating cache ./config.cache
configure:2295: checking build system type
configure:2309: result: x86_64-pc-linux-gnu
configure:2329: checking host system type
configure:2342: result: arm-none-eabi
configure:2448: checking for --enable-version-specific-runtime-libs
configure:2461: result: no
configure:2532: checking for a BSD-compatible install
configure:2600: result: /usr/bin/install -c
configure:2616: checking for gawk
configure:2643: result: gawk
configure:2766: checking for arm-none-eabi-ar
configure:2793: result: arm-none-eabi-ar
configure:2858: checking for arm-none-eabi-lipo
configure:2885: result: arm-none-eabi-lipo
configure:2950: checking for arm-none-eabi-nm
configure:2977: result: /home/users/truiz/projects/rtos_compiler/build/./gcc/nm
configure:3042: checking for arm-none-eabi-ranlib
configure:3069: result: arm-none-eabi-ranlib
configure:3134: checking for arm-none-eabi-strip
configure:3161: result: arm-none-eabi-strip
configure:3223: checking whether ln -s works
configure:3227: result: yes
configure:3244: checking for arm-none-eabi-gcc
configure:3271: result: /home/users/truiz/projects/rtos_compiler/build/./gcc/xgcc -B/home/users/truiz/projects/rtos_compiler/build/./gcc/ -B/arm-none-eabi/bin/ -B/arm-none-eabi/lib/ -isystem /arm-none-eabi/include -isystem /arm-none-eabi/sys-include   
configure:3540: checking for C compiler version
configure:3549: /home/users/truiz/projects/rtos_compiler/build/./gcc/xgcc -B/home/users/truiz/projects/rtos_compiler/build/./gcc/ -B/arm-none-eabi/bin/ -B/arm-none-eabi/lib/ -isystem /arm-none-eabi/include -isystem /arm-none-eabi/sys-include    --version >&5
xgcc (Arch Repository) 13.1.0
Copyright (C) 2023 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:3560: $? = 0
configure:3549: /home/users/truiz/projects/rtos_compiler/build/./gcc/xgcc -B/home/users/truiz/projects/rtos_compiler/build/./gcc/ -B/arm-none-eabi/bin/ -B/arm-none-eabi/lib/ -isystem /arm-none-eabi/include -isystem /arm-none-eabi/sys-include    -v >&5
Reading specs from /home/users/truiz/projects/rtos_compiler/build/./gcc/specs
COLLECT_GCC=/home/users/truiz/projects/rtos_compiler/build/./gcc/xgcc
COLLECT_LTO_WRAPPER=/home/users/truiz/projects/rtos_compiler/build/./gcc/lto-wrapper
Target: arm-none-eabi
Configured with: ../gcc/configure --target=arm-none-eabi --prefix= --with-sysroot=/arm-none-eabi --with-native-system-header-dir=/include --libexecdir=/usr/lib --enable-languages=c,c++ --enable-plugins --disable-decimal-float --disable-libffi --disable-libgomp --disable-libmudflap --disable-libquadmath --disable-libssp --disable-libstdcxx-pch --disable-nls --disable-shared --disable-threads --disable-tls --with-gnu-as --with-gnu-ld --with-system-zlib --with-newlib --with-headers=/arm-none-eabi/include --with-python-dir=share/gcc-arm-none-eabi --with-gmp=/usr/local/gmp --with-mpfr=/usr/local/mpfr --with-mpc=/usr/local/mpc --with-isl=/usr/local/isl --with-libelf --enable-gnu-indirect-function --with-host-libstdcxx='-static-libgcc -Wl,-Bstatic,-lstdc++,-Bdynamic -lm' --with-pkgversion='Arch Repository' --with-bugurl=https://bugs.archlinux.org/ --with-multilib-list=rmprofile
Thread model: single
Supported LTO compression algorithms: zlib
gcc version 13.1.0 (Arch Repository) 
configure:3560: $? = 0
configure:3549: /home/users/truiz/projects/rtos_compiler/build/./gcc/xgcc -B/home/users/truiz/projects/rtos_compiler/build/./gcc/ -B/arm-none-eabi/bin/ -B/arm-none-eabi/lib/ -isystem /arm-none-eabi/include -isystem /arm-none-eabi/sys-include    -V >&5
xgcc: error: unrecognized command-line option '-V'
xgcc: fatal error: no input files
compilation terminated.
configure:3560: $? = 1
configure:3549: /home/users/truiz/projects/rtos_compiler/build/./gcc/xgcc -B/home/users/truiz/projects/rtos_compiler/build/./gcc/ -B/arm-none-eabi/bin/ -B/arm-none-eabi/lib/ -isystem /arm-none-eabi/include -isystem /arm-none-eabi/sys-include    -qversion >&5
xgcc: error: unrecognized command-line option '-qversion'; did you mean '--version'?
xgcc: fatal error: no input files
compilation terminated.
configure:3560: $? = 1
configure:3576: /home/users/truiz/projects/rtos_compiler/build/./gcc/xgcc -B/home/users/truiz/projects/rtos_compiler/build/./gcc/ -B/arm-none-eabi/bin/ -B/arm-none-eabi/lib/ -isystem /arm-none-eabi/include -isystem /arm-none-eabi/sys-include    -o conftest -g -Os -ffunction-sections -fdata-sections   conftest.c  >&5
conftest.c:9:10: fatal error: stdio.h: No such file or directory
    9 | #include <stdio.h>
      |          ^~~~~~~~~
compilation terminated.
configure:3579: $? = 1
configure:3792: checking for suffix of object files
configure:3814: /home/users/truiz/projects/rtos_compiler/build/./gcc/xgcc -B/home/users/truiz/projects/rtos_compiler/build/./gcc/ -B/arm-none-eabi/bin/ -B/arm-none-eabi/lib/ -isystem /arm-none-eabi/include -isystem /arm-none-eabi/sys-include    -c -g -Os -ffunction-sections -fdata-sections  conftest.c >&5
/home/users/truiz/projects/rtos_compiler/build/./gcc/as: 114: exec: -march=armv4t: not found
configure:3818: $? = 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:3832: error: in `/home/users/truiz/projects/rtos_compiler/build/arm-none-eabi/libgcc':
configure:3834: error: cannot compute suffix of object files: cannot compile
See `config.log' for more details

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

ac_cv_build=x86_64-pc-linux-gnu
ac_cv_env_CC_set=set
ac_cv_env_CC_value='/home/users/truiz/projects/rtos_compiler/build/./gcc/xgcc -B/home/users/truiz/projects/rtos_compiler/build/./gcc/ -B/arm-none-eabi/bin/ -B/arm-none-eabi/lib/ -isystem /arm-none-eabi/include -isystem /arm-none-eabi/sys-include   '
ac_cv_env_CFLAGS_set=set
ac_cv_env_CFLAGS_value='-g -Os -ffunction-sections -fdata-sections'
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=x86_64-pc-linux-gnu
ac_cv_env_host_alias_set=set
ac_cv_env_host_alias_value=arm-none-eabi
ac_cv_env_target_alias_set=set
ac_cv_env_target_alias_value=arm-none-eabi
ac_cv_host=arm-none-eabi
ac_cv_prog_AR=arm-none-eabi-ar
ac_cv_prog_AWK=gawk
ac_cv_prog_CC='/home/users/truiz/projects/rtos_compiler/build/./gcc/xgcc -B/home/users/truiz/projects/rtos_compiler/build/./gcc/ -B/arm-none-eabi/bin/ -B/arm-none-eabi/lib/ -isystem /arm-none-eabi/include -isystem /arm-none-eabi/sys-include   '
ac_cv_prog_LIPO=arm-none-eabi-lipo
ac_cv_prog_NM=/home/users/truiz/projects/rtos_compiler/build/./gcc/nm
ac_cv_prog_RANLIB=arm-none-eabi-ranlib
ac_cv_prog_STRIP=arm-none-eabi-strip

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

AR='arm-none-eabi-ar'
AWK='gawk'
CC='/home/users/truiz/projects/rtos_compiler/build/./gcc/xgcc -B/home/users/truiz/projects/rtos_compiler/build/./gcc/ -B/arm-none-eabi/bin/ -B/arm-none-eabi/lib/ -isystem /arm-none-eabi/include -isystem /arm-none-eabi/sys-include   '
CET_FLAGS=''
CFLAGS='-g -Os -ffunction-sections -fdata-sections'
CPP=''
CPPFLAGS=''
DEFS=''
ECHO_C=''
ECHO_N='-n'
ECHO_T=''
EGREP=''
EXEEXT=''
GREP=''
INSTALL_DATA='/usr/bin/install -c -m 644'
INSTALL_PROGRAM='/usr/bin/install -c'
INSTALL_SCRIPT='/usr/bin/install -c'
LDFLAGS=''
LIBOBJS=''
LIBS=''
LIPO='arm-none-eabi-lipo'
LN_S='ln -s'
LTLIBOBJS=''
MAINT='#'
NM='/home/users/truiz/projects/rtos_compiler/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=':'
PICFLAG='-fPIC'
RANLIB='arm-none-eabi-ranlib'
SHELL='/bin/bash'
STRIP='arm-none-eabi-strip'
ac_ct_CC=''
accel_dir_suffix=''
asm_hidden_op=''
bindir='${exec_prefix}/bin'
build='x86_64-pc-linux-gnu'
build_alias='x86_64-pc-linux-gnu'
build_cpu='x86_64'
build_libsubdir='build-x86_64-pc-linux-gnu'
build_os='linux-gnu'
build_subdir='build-x86_64-pc-linux-gnu'
build_vendor='pc'
cpu_type=''
datadir='${datarootdir}'
datarootdir='${prefix}/share'
decimal_float=''
docdir='${datarootdir}/doc/${PACKAGE_TARNAME}'
double_type_size=''
dvidir='${docdir}'
enable_decimal_float='no'
enable_execute_stack=''
enable_gcov='yes'
enable_shared='no'
enable_vtable_verify='no'
exec_prefix='NONE'
extra_parts=''
fixed_point=''
force_explicit_eh_registry=''
get_gcc_base_ver=''
host='arm-none-eabi'
host_alias='arm-none-eabi'
host_cpu='arm'
host_noncanonical='arm-none-eabi'
host_os='eabi'
host_subdir='.'
host_vendor='none'
htmldir='${docdir}'
includedir='${prefix}/include'
infodir='${datarootdir}/info'
libdir='${exec_prefix}/lib'
libexecdir='/usr/lib'
libgcc_topdir='../../../gcc/libgcc/..'
localedir='${datarootdir}/locale'
localstatedir='${prefix}/var'
long_double_type_size=''
mandir='${datarootdir}/man'
md_unwind_header=''
oldincludedir='/usr/include'
pdfdir='${docdir}'
prefix=''
program_transform_name='s&^&arm-none-eabi-&'
psdir='${docdir}'
real_host_noncanonical=''
sbindir='${exec_prefix}/sbin'
set_have_cc_tls=''
set_use_emutls=''
sfp_machine_header=''
sharedstatedir='${prefix}/com'
slibdir='$(exec_prefix)/$(host_noncanonical)/lib'
solaris_ld_v2_maps=''
sysconfdir='${prefix}/etc'
target_alias='arm-none-eabi'
target_noncanonical='arm-none-eabi'
target_subdir='arm-none-eabi'
thread_header=''
tm_defines=''
tm_file=''
tmake_file=''
toolexecdir='$(exec_prefix)/$(target_noncanonical)'
toolexeclibdir='$(toolexecdir)/lib'
unwind_header=''
use_tm_clone_registry=''
vis_hide=''
with_aix_soname='aix'

## ----------- ##
## 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

0

There are 0 best solutions below