Como construir um gcc-4.9.0 com sucesso em solaris 10 sparc

0

Eu estou tentando construir um gcc-4.9.0 no Solaris 10 sparc.

O gmp foi desenvolvido e instalado com sucesso em

/application/gmp-6.0.0a 

O mpfr também foi construído e instalado com sucesso em

/application/mpfr-3.1.2

o mpc foi instalado em

/application/mpc-1.0.2 

Em seguida, no diretório do aplicativo, eu tenho um subdiretório chamado gcc-4.9.0 que também contém src e src contém objdir. O gcc-4.9.0.tar.gz extraído foi movido para o diretório src. A estrutura se parece com isso

/application
          - /gcc-4.9.0
                     -/ src 
                          - /objdir
                          - /gcc-4.9.0 // The extracted gcc-4.9.0.tar.gz

O configurei assim

    cd /application/gcc-4.9.0/src/objdir
       # ../configure --build=sparc-sun-solaris2.10
           --with-gmp=/application/gmp-6.0.0a 
           --with-mpfr=/application/mpfr-3.1.2 
           --with-mpc=/application/mpc-1.0.2 
           --with-gnu-as  
           --with-gnu-ld 
           --enable-shared 
           --disable-nls 
           --enable-languages=c,c++,objc 
           --prefix=/application/gcc-4.9.0 

A configuração foi bem sucedida e o arquivo foi criado

O eu corri

gmake 

Infelizmente, isso ocorreu por vários minutos, mas terminou com esse erro

configure: error: cannot compute suffix of object files: cannot compile
See 'config.log' for more details

Infelizmente, o config.log não contém uma mensagem abrangente.

Eu estive nisso por semanas. Por favor, como resolvo isso?

O conteúdo do config.log é:

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

  $ /application/gcc-4.9.0/src/libgcc/configure --cache-file=./config.cache --enable-multilib --with-gmp=/application/gmp-6.0.0a --with-mpfr=/application/mpfr-3.1.2 --with-mpc=/application/mpc-1.0.2 --with-gnu-as --with-gnu-ld --enable-shared --disable-nls --prefix=/application/gcc-4.9.0 --enable-languages=c,c++,lto,objc --program-transform-name=s,y,y, --disable-option-checking --with-target-subdir=sparc-sun-solaris2.10 --build=sparc-sun-solaris2.10 --host=sparc-sun-solaris2.10 --target=sparc-sun-solaris2.10 --srcdir=../../../libgcc --disable-intermodule --enable-checking=yes,types --disable-coverage --enable-languages=c,c++,lto --disable-build-format-warnings

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

hostname = XXXXXXX
uname -m = sun4v
uname -r = 5.10
uname -s = SunOS
uname -v = Generic_150400-28

/usr/bin/uname -p = sparc
/bin/uname -X     = System = SunOS
Node = XXXXXXXX
Release = 5.10
KernelID = Generic_150400-28
Machine = sun4v
BusType = <unknown>
Serial = <unknown>
Users = <unknown>
OEM# = 0
Origin# = 1
NumCPU = 256

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

PATH: /usr/sbin
PATH: /usr/bin
PATH: /usr/ccs/bin
PATH: /usr/openwin/bin
PATH: /usr/dt/bin
PATH: /usr/platform/sun4v/sbin
PATH: /opt/sun/bin
PATH: /opt/SUNWexplo/bin
PATH: /opt/SUNWsneep/bin
PATH: /opt/CTEact/bin
PATH: /usr/local/bin
PATH: /usr/sfw/bin


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

configure:1980: creating cache ./config.cache
configure:2163: checking build system type
configure:2177: result: sparc-sun-solaris2.10
configure:2197: checking host system type
configure:2210: result: sparc-sun-solaris2.10
configure:2307: checking for --enable-version-specific-runtime-libs
configure:2320: result: no
configure:2368: checking for a BSD-compatible install
configure:2436: result: /application/gcc-4.9.0/src/install-sh -c
configure:2452: checking for gawk
configure:2479: result: nawk
configure:2579: checking for sparc-sun-solaris2.10-ar
configure:2606: result: ar
configure:2671: checking for sparc-sun-solaris2.10-lipo
configure:2698: result: lipo
configure:2763: checking for sparc-sun-solaris2.10-nm
configure:2790: result: /application/gcc-4.9.0/src/objdir/./gcc/nm
configure:2855: checking for sparc-sun-solaris2.10-ranlib
configure:2882: result: ranlib
configure:2947: checking for sparc-sun-solaris2.10-strip
configure:2974: result: strip
configure:3036: checking whether ln -s works
configure:3040: result: yes
configure:3057: checking for sparc-sun-solaris2.10-gcc
configure:3084: result: /application/gcc-4.9.0/src/objdir/./gcc/xgcc -B/application/gcc-4.9.0/src/objdir/./gcc/ -B/application/gcc-4.9.0/sparc-sun-solaris2.10/bin/ -B/application/gcc-4.9.0/sparc-sun-solaris2.10/lib/ -isystem /application/gcc-4.9.0/sparc-sun-solaris2.10/include -isystem /application/gcc-4.9.0/sparc-sun-solaris2.10/sys-include   
configure:3353: checking for C compiler version
configure:3362: /application/gcc-4.9.0/src/objdir/./gcc/xgcc -B/application/gcc-4.9.0/src/objdir/./gcc/ -B/application/gcc-4.9.0/sparc-sun-solaris2.10/bin/ -B/application/gcc-4.9.0/sparc-sun-solaris2.10/lib/ -isystem /application/gcc-4.9.0/sparc-sun-solaris2.10/include -isystem /application/gcc-4.9.0/sparc-sun-solaris2.10/sys-include    --version >&5
xgcc (GCC) 4.9.0
Copyright (C) 2014 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:3373: $? = 0
configure:3362: /application/gcc-4.9.0/src/objdir/./gcc/xgcc -B/application/gcc-4.9.0/src/objdir/./gcc/ -B/application/gcc-4.9.0/sparc-sun-solaris2.10/bin/ -B/application/gcc-4.9.0/sparc-sun-solaris2.10/lib/ -isystem /application/gcc-4.9.0/sparc-sun-solaris2.10/include -isystem /application/gcc-4.9.0/sparc-sun-solaris2.10/sys-include    -v >&5
Reading specs from /application/gcc-4.9.0/src/objdir/./gcc/specs
COLLECT_GCC=/application/gcc-4.9.0/src/objdir/./gcc/xgcc
COLLECT_LTO_WRAPPER=/application/gcc-4.9.0/src/objdir/./gcc/lto-wrapper
Target: sparc-sun-solaris2.10
Configured with: ../configure --build=sparc-sun-solaris2.10 --with-gmp=/application/gmp-6.0.0a --with-mpfr=/application/mpfr-3.1.2 --with-mpc=/application/mpc-1.0.2 --with-gnu-as --with-gnu-ld --enable-shared --disable-nls --enable-languages=c,c++,objc --prefix=/application/gcc-4.9.0
Thread model: posix
gcc version 4.9.0 (GCC) 
configure:3373: $? = 0
configure:3362: /application/gcc-4.9.0/src/objdir/./gcc/xgcc -B/application/gcc-4.9.0/src/objdir/./gcc/ -B/application/gcc-4.9.0/sparc-sun-solaris2.10/bin/ -B/application/gcc-4.9.0/sparc-sun-solaris2.10/lib/ -isystem /application/gcc-4.9.0/sparc-sun-solaris2.10/include -isystem /application/gcc-4.9.0/sparc-sun-solaris2.10/sys-include    -V >&5
xgcc: error: unrecognized command line option '-V'
xgcc: fatal error: no input files
compilation terminated.
configure:3373: $? = 1
configure:3362: /application/gcc-4.9.0/src/objdir/./gcc/xgcc -B/application/gcc-4.9.0/src/objdir/./gcc/ -B/application/gcc-4.9.0/sparc-sun-solaris2.10/bin/ -B/application/gcc-4.9.0/sparc-sun-solaris2.10/lib/ -isystem /application/gcc-4.9.0/sparc-sun-solaris2.10/include -isystem /application/gcc-4.9.0/sparc-sun-solaris2.10/sys-include    -qversion >&5
xgcc: error: unrecognized command line option '-qversion'
xgcc: fatal error: no input files
compilation terminated.
configure:3373: $? = 1
configure:3389: /application/gcc-4.9.0/src/objdir/./gcc/xgcc -B/application/gcc-4.9.0/src/objdir/./gcc/ -B/application/gcc-4.9.0/sparc-sun-solaris2.10/bin/ -B/application/gcc-4.9.0/sparc-sun-solaris2.10/lib/ -isystem /application/gcc-4.9.0/sparc-sun-solaris2.10/include -isystem /application/gcc-4.9.0/sparc-sun-solaris2.10/sys-include    -o conftest -g -O2   conftest.c  >&5
ld.so.1: cc1: fatal: libmpc.so.3: open failed: No such file or directory
xgcc: internal compiler error: Killed (program cc1)
no stack trace because unwind library not available
Please submit a full bug report,
with preprocessed source if appropriate.
See <http://gcc.gnu.org/bugs.html> for instructions.
configure:3392: $? = 4
configure:3580: checking for suffix of object files
configure:3602: /application/gcc-4.9.0/src/objdir/./gcc/xgcc -B/application/gcc-4.9.0/src/objdir/./gcc/ -B/application/gcc-4.9.0/sparc-sun-solaris2.10/bin/ -B/application/gcc-4.9.0/sparc-sun-solaris2.10/lib/ -isystem /application/gcc-4.9.0/sparc-sun-solaris2.10/include -isystem /application/gcc-4.9.0/sparc-sun-solaris2.10/sys-include    -c -g -O2  conftest.c >&5
ld.so.1: cc1: fatal: libmpc.so.3: open failed: No such file or directory
xgcc: internal compiler error: Killed (program cc1)
no stack trace because unwind library not available
Please submit a full bug report,
with preprocessed source if appropriate.
See <http://gcc.gnu.org/bugs.html> for instructions.
configure:3606: $? = 4
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:3620: error: in '/application/gcc-4.9.0/src/objdir/sparc-sun-solaris2.10/libgcc':
configure:3623: error: cannot compute suffix of object files: cannot compile
See 'config.log' for more details.

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

ac_cv_build=sparc-sun-solaris2.10
ac_cv_env_CC_set=set
ac_cv_env_CC_value='/application/gcc-4.9.0/src/objdir/./gcc/xgcc -B/application/gcc-4.9.0/src/objdir/./gcc/ -B/application/gcc-4.9.0/sparc-sun-solaris2.10/bin/ -B/application/gcc-4.9.0/sparc-sun-solaris2.10/lib/ -isystem /application/gcc-4.9.0/sparc-sun-solaris2.10/include -isystem /application/gcc-4.9.0/sparc-sun-solaris2.10/sys-include   '
ac_cv_env_CFLAGS_set=set
ac_cv_env_CFLAGS_value='-g -O2'
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=sparc-sun-solaris2.10
ac_cv_env_host_alias_set=set
ac_cv_env_host_alias_value=sparc-sun-solaris2.10
ac_cv_env_target_alias_set=set
ac_cv_env_target_alias_value=sparc-sun-solaris2.10
ac_cv_host=sparc-sun-solaris2.10
ac_cv_prog_AR=ar
ac_cv_prog_AWK=nawk
ac_cv_prog_CC='/application/gcc-4.9.0/src/objdir/./gcc/xgcc -B/application/gcc-4.9.0/src/objdir/./gcc/ -B/application/gcc-4.9.0/sparc-sun-solaris2.10/bin/ -B/application/gcc-4.9.0/sparc-sun-solaris2.10/lib/ -isystem /application/gcc-4.9.0/sparc-sun-solaris2.10/include -isystem /application/gcc-4.9.0/sparc-sun-solaris2.10/sys-include   '
ac_cv_prog_LIPO=lipo
ac_cv_prog_NM=/application/gcc-4.9.0/src/objdir/./gcc/nm
ac_cv_prog_RANLIB=ranlib
ac_cv_prog_STRIP=strip

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

AR='ar'
AWK='nawk'
CC='/application/gcc-4.9.0/src/objdir/./gcc/xgcc -B/application/gcc-4.9.0/src/objdir/./gcc/ -B/application/gcc-4.9.0/sparc-sun-solaris2.10/bin/ -B/application/gcc-4.9.0/sparc-sun-solaris2.10/lib/ -isystem /application/gcc-4.9.0/sparc-sun-solaris2.10/include -isystem /application/gcc-4.9.0/sparc-sun-solaris2.10/sys-include   '
CFLAGS='-g -O2'
CPP=''
CPPFLAGS=''
DEFS=''
ECHO_C=''
ECHO_N='-n'
ECHO_T=''
EXEEXT=''
INSTALL_DATA='/application/gcc-4.9.0/src/install-sh -c -m 644'
INSTALL_PROGRAM='/application/gcc-4.9.0/src/install-sh -c'
INSTALL_SCRIPT='/application/gcc-4.9.0/src/install-sh -c'
LDFLAGS=''
LIBOBJS=''
LIBS=''
LIPO='lipo'
LN_S='ln -s'
LTLIBOBJS=''
MAINT='#'
NM='/application/gcc-4.9.0/src/objdir/./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='ranlib'
SHELL='/bin/bash'
STRIP='strip'
ac_ct_CC=''
asm_hidden_op=''
bindir='${exec_prefix}/bin'
build='sparc-sun-solaris2.10'
build_alias='sparc-sun-solaris2.10'
build_cpu='sparc'
build_libsubdir='build-sparc-sun-solaris2.10'
build_os='solaris2.10'
build_subdir='build-sparc-sun-solaris2.10'
build_vendor='sun'
cpu_type=''
datadir='${datarootdir}'
datarootdir='${prefix}/share'
decimal_float=''
docdir='${datarootdir}/doc/${PACKAGE_TARNAME}'
double_type_size=''
dvidir='${docdir}'
enable_decimal_float=''
enable_shared='yes'
enable_vtable_verify='no'
exec_prefix='NONE'
extra_parts=''
fixed_point=''
host='sparc-sun-solaris2.10'
host_alias='sparc-sun-solaris2.10'
host_cpu='sparc'
host_noncanonical='sparc-sun-solaris2.10'
host_os='solaris2.10'
host_subdir='.'
host_vendor='sun'
htmldir='${docdir}'
includedir='${prefix}/include'
infodir='${datarootdir}/info'
libdir='${exec_prefix}/lib'
libexecdir='${exec_prefix}/libexec'
libgcc_topdir='../../../libgcc/..'
localedir='${datarootdir}/locale'
localstatedir='${prefix}/var'
long_double_type_size=''
mandir='${datarootdir}/man'
oldincludedir='/usr/include'
pdfdir='${docdir}'
prefix='/application/gcc-4.9.0'
program_transform_name='s,y,y,'
psdir='${docdir}'
sbindir='${exec_prefix}/sbin'
set_have_cc_tls=''
set_use_emutls=''
sfp_machine_header=''
sharedstatedir='${prefix}/com'
slibdir='$(libdir)'
sysconfdir='${prefix}/etc'
target_alias='sparc-sun-solaris2.10'
target_noncanonical='sparc-sun-solaris2.10'
target_subdir='sparc-sun-solaris2.10'
thread_header=''
tm_defines=''
tm_file=''
tmake_file=''
toolexecdir='$(libdir)/gcc-lib/$(target_noncanonical)'
toolexeclibdir='$(libdir)'
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
    
por kplus 29.05.2018 / 20:00

2 respostas

1

Consegui criar com sucesso o gcc-4.9.0. desta pergunta: link ; Vi esta resposta link que foi particularmente útil para esta solução.

Abaixo estão as etapas realizadas

1. Faça o download dos arquivos necessários. Para construir o gcc, são necessárias três dependências:

a. GNU Multiple Precision Arithmetic Library (GMP) - Eu usei o gmp-6.0.0

b. Múltipla precisão de ponto flutuante GNU confiável (MPFR) - eu usei mpfr-3.1.2

c. O GNU MPC - mpc-1.0.2 foi usado.

Tudo isso pode ser baixado aqui: link , você também pode baixar o gcc de um dos seus sites espelho aqui link

2. Declarar suas variáveis

    gccver=4.9.0

    gmpver=6.0.0

    mpfrver=3.1.2

    mpcver=1.0.2

    # where you downloaded source packages

    pkgdir=$HOME

    # where gcc will be built
    rootdir=$HOME/gcc-tmp


    # where gcc will be installed 
    prefix=/opt/gcc-${gccver}

    # the languages you want gcc to support
    langs=c,c++

3. Crie um novo diretório onde você deseja manter as fontes e extrair as fontes lá

     mkdir ${rootdir}

     cd ${rootdir}


    gzip -dc ${pkgdir}/gcc-${gccver}.tar.gz | tar xvf - 
    gzip -dc ${pkgdir}/gcc-${gmpver}.tar.gz | tar xvf - 
    gzip -dc ${pkgdir}/gcc-${mpfrver}.tar.gz | tar xvf - 
    gzip -dc ${pkgdir}/gcc-${mpcver}.tar.gz | tar xvf - 

OBSERVAÇÃO: se você tiver um problema como erro de soma de verificação ao extrair o arquivo, consulte: Como extrair corretamente a .tar.gz com md5.sum no solaris 10 para soluções.

4. Agora, mova as fontes extraídas para o diretório de origem do gcc

    mv gmp-${gmpver}   gcc-${gccver}/gmp

    mv mpfr-${mpfrver} gcc-${gccver}/mpfr

    mv mpc-${mpcver}   gcc-${gccver}/mpc

5. Crie um diretório de criação e mude para ele

    mkdir objdir

    cd objdir

6. Agora configure o gcc:

    ${rootdir}/gcc-${gccver}/configure --prefix=${prefix}   --enable-languages=${langs}

7. Então, construa o gcc

     gmake 

8. Finalmente, instale o gcc:

     gmake install

É isso!

Embora o gcc.4.9.0 tenha sido construído, o passo também pode ser seguido para construir outras versões.

Você pode querer testar seu gcc recém-instalado para ver se funciona ou não, eis como:

Crie um arquivo hello.c simples como este

#include <stdio.h>

int
main (void)
{
  printf ("Hello, world!\n");
  return 0;
}

depois do uso do terminal

   /opt//opt/gcc-4.9.0/bin/gcc hello.c -o hello

You should see hello filed created in the same directory as hello.c
    
por 31.05.2018 / 10:47
0

O arquivo de log alega que você chamou configure com a instrução para ligar a biblioteca GNU mp que não é padrão e, portanto, não está presente em seu sistema.

Você fez isso?

Você fez isso intencionalmente?

    
por 29.05.2018 / 20:50