• Willkommen im Linux Club - dem deutschsprachigen Supportforum für GNU/Linux. Registriere dich kostenlos, um alle Inhalte zu sehen und Fragen zu stellen.

[closed] RPM Built läuft nicht durch. C++ Compiler nicht da

Ich versuche gerade ein RPM zusammen zu bauen und scheitere momentan am gcc. Das SPEC File und SOURCE File sind in den richtigen Verzeichnissen hinterlegt und der Befehl zum loslegen lautet: rpmbuild -bb /usr/src/packages/SPECS/linux-cwa-0.8.7-2.spec

Er steigt an der folgenden Stelle aus:
Code:
checking for x86_64-pc-linux-gnu-g++... no
checking for x86_64-pc-linux-gnu-c++... no
checking for x86_64-pc-linux-gnu-gpp... no
checking for x86_64-pc-linux-gnu-aCC... no
checking for x86_64-pc-linux-gnu-CC... no
checking for x86_64-pc-linux-gnu-cxx... no
checking for x86_64-pc-linux-gnu-cc++... no
checking for x86_64-pc-linux-gnu-cl... no
checking for x86_64-pc-linux-gnu-FCC... no
checking for x86_64-pc-linux-gnu-KCC... no
checking for x86_64-pc-linux-gnu-RCC... no
checking for x86_64-pc-linux-gnu-xlC_r... no
checking for x86_64-pc-linux-gnu-xlC... no
checking for g++... g++
checking for C++ compiler default output file name... configure: error: C++ compiler cannot create executables
See `config.log' for more details.
error: Bad exit status from /var/tmp/rpm-tmp.62890 (%build)

Installiert sind die aufgeführten Compiler:
zypper se -i gcc
Code:
Refreshing service 'nu_novell_com'.
Loading repository data...
Reading installed packages...

S | Name                 | Summary                                             | Type
--+----------------------+-----------------------------------------------------+--------
i | cross-spu-gcc-static | The GNU C Compiler for Cell SPU Processors (static) | package
i | gcc                  | The system GNU C Compiler                           | package
i | gcc-c++              | The system GNU C++ Compiler                         | package
i | gcc43                | The GNU C Compiler and Support Files                | package
i | gcc43-c++            | The GNU C++ Compiler                                | package
i | gcc45                | The GNU C Compiler and Support Files                | package
i | gcc45-c++            | The GNU C++ Compiler                                | package
i | libgcc43             | C compiler runtime library                          | package
i | libgcc43-32bit       | C compiler runtime library                          | package
i | libgcc45             | C compiler runtime library                          | package

Die config-Log bringt mir auch nicht mehr Informationen. Was lässt sich sonst noch machen?
 
Also beim rpmbuilt-Error von oben ist von den 64Bit Versionen die Rede. Ich denke die brauch ich auch und würde meinen, dass die auch in 64Bit vorliegen. Über Yast kann man die 32 Bit Versionen ja noc extra hinzuinstallieren. Bisher hatte ich das Paket nicht mitinstalliert. Werde ich gleich mal machen.
Ansonsten lösen viele das Problem indem sie Buil-Essentials nachinstallieren, aber halt leider auf Debian Systemen.

*Edit*

Die 32Bit Version zu installieren brachte leider auch keine Veränderung!
 
Laut der config.log liegt das Problem an dieser Stelle:

configure:2105: checking for C++ compiler default output file name
configure:2108: g++ -march=x86_64 -mtune=x86_64 -O2 conftest.cc >&5
conftest.cc:1: error: bad value (x86_64) for -march= switch
conftest.cc:1: error: bad value (x86_64) for -mtune= switch

Sagt mir jetzt irgendwie recht wenig. Hier mal der gesamte Output der config.log:

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

It was created by linux-cwc configure 0.8.7, which was
generated by GNU Autoconf 2.59.  Invocation command line was

  $ ./configure --host=x86_64-pc-linux-gnu --build=x86_64-pc-linux-gnu --target=x86_64-linux-linux --program-prefix= --prefix=/ --exec-prefix=/ --bindir=//bin --sbindir=//sbin --sysconfdir=/etc --datadir=//share --includedir=//include --libdir=//lib64 --libexecdir=//lib64 --localstatedir=/var --sharedstatedir=//com --mandir=//share/man --infodir=//share/info --with-pam-sshd --with-pam-samba --with-nsswitch

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

hostname = server2
uname -m = x86_64
uname -r = 2.6.32.29-0.3-default
uname -s = Linux
uname -v = #1 SMP 2011-02-25 13:36:59 +0100

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

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

PATH: /sbin
PATH: /usr/sbin
PATH: /usr/local/sbin
PATH: /root/bin
PATH: /usr/local/bin
PATH: /usr/bin
PATH: /bin
PATH: /usr/bin/X11
PATH: /usr/X11R6/bin
PATH: /usr/games
PATH: /opt/cross/bin
PATH: /usr/lib/mit/bin
PATH: /usr/lib/mit/sbin


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

configure:1570: checking for a BSD-compatible install
configure:1625: result: /usr/bin/install -c
configure:1636: checking whether build environment is sane
configure:1679: result: yes
configure:1744: checking for gawk
configure:1760: found /usr/bin/gawk
configure:1770: result: gawk
configure:1780: checking whether make sets $(MAKE)
configure:1800: result: yes
configure:1982: checking for x86_64-pc-linux-gnu-g++
configure:2011: result: no
configure:1982: checking for x86_64-pc-linux-gnu-c++
configure:2011: result: no
configure:1982: checking for x86_64-pc-linux-gnu-gpp
configure:2011: result: no
configure:1982: checking for x86_64-pc-linux-gnu-aCC
configure:2011: result: no
configure:1982: checking for x86_64-pc-linux-gnu-CC
configure:2011: result: no
configure:1982: checking for x86_64-pc-linux-gnu-cxx
configure:2011: result: no
configure:1982: checking for x86_64-pc-linux-gnu-cc++
configure:2011: result: no
configure:1982: checking for x86_64-pc-linux-gnu-cl
configure:2011: result: no
configure:1982: checking for x86_64-pc-linux-gnu-FCC
configure:2011: result: no
configure:1982: checking for x86_64-pc-linux-gnu-KCC
configure:2011: result: no
configure:1982: checking for x86_64-pc-linux-gnu-RCC
configure:2011: result: no
configure:1982: checking for x86_64-pc-linux-gnu-xlC_r
configure:2011: result: no
configure:1982: checking for x86_64-pc-linux-gnu-xlC
configure:2011: result: no
configure:2024: checking for g++
configure:2040: found /usr/bin/g++
configure:2050: result: g++
configure:2066: checking for C++ compiler version
configure:2069: g++ --version </dev/null >&5
g++ (SUSE Linux) 4.3.4 [gcc-4_3-branch revision 152973]
Copyright (C) 2008 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:2072: $? = 0
configure:2074: g++ -v </dev/null >&5
Using built-in specs.
Target: x86_64-suse-linux
Configured with: ../configure --prefix=/usr --infodir=/usr/share/info --mandir=/usr/share/man --libdir=/usr/lib64 --libexecdir=/usr/lib64 --enable-languages=c,c++,objc,fortran,obj-c++,java,ada --enable-checking=release --with-gxx-include-dir=/usr/include/c++/4.3 --enable-ssp --disable-libssp --with-bugurl=http://bugs.opensuse.org/ --with-pkgversion='SUSE Linux' --disable-libgcj --disable-libmudflap --with-slibdir=/lib64 --with-system-zlib --enable-__cxa_atexit --enable-libstdcxx-allocator=new --disable-libstdcxx-pch --enable-version-specific-runtime-libs --program-suffix=-4.3 --enable-linux-futex --without-system-libunwind --with-cpu=generic --build=x86_64-suse-linux
Thread model: posix
gcc version 4.3.4 [gcc-4_3-branch revision 152973] (SUSE Linux) 
configure:2077: $? = 0
configure:2079: g++ -V </dev/null >&5
g++: '-V' option must have argument
configure:2082: $? = 1
configure:2105: checking for C++ compiler default output file name
configure:2108: g++ -march=x86_64 -mtune=x86_64 -O2   conftest.cc  >&5
conftest.cc:1: error: bad value (x86_64) for -march= switch
conftest.cc:1: error: bad value (x86_64) for -mtune= switch
configure:2111: $? = 1
configure: failed program was:
| /* confdefs.h.  */
| 
| #define PACKAGE_NAME "linux-cwc"
| #define PACKAGE_TARNAME "linux-cwc"
| #define PACKAGE_VERSION "0.8.7"
| #define PACKAGE_STRING "linux-cwc 0.8.7"
| #define PACKAGE "linux-cwc"
| #define VERSION "0.8.7"
| /* end confdefs.h.  */
| 
| int
| main ()
| {
| 
|   ;
|   return 0;
| }
configure:2150: error: C++ compiler cannot create executables
See `config.log' for more details.

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

ac_cv_env_CC_set=
ac_cv_env_CC_value=
ac_cv_env_CFLAGS_set=set
ac_cv_env_CFLAGS_value='-march=x86_64 -mtune=x86_64 -O2'
ac_cv_env_CPPFLAGS_set=
ac_cv_env_CPPFLAGS_value=
ac_cv_env_CPP_set=
ac_cv_env_CPP_value=
ac_cv_env_CXXCPP_set=
ac_cv_env_CXXCPP_value=
ac_cv_env_CXXFLAGS_set=set
ac_cv_env_CXXFLAGS_value='-march=x86_64 -mtune=x86_64 -O2'
ac_cv_env_CXX_set=
ac_cv_env_CXX_value=
ac_cv_env_F77_set=
ac_cv_env_F77_value=
ac_cv_env_FFLAGS_set=set
ac_cv_env_FFLAGS_value='-march=x86_64 -mtune=x86_64 -O2'
ac_cv_env_LDFLAGS_set=
ac_cv_env_LDFLAGS_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=x86_64-pc-linux-gnu
ac_cv_env_target_alias_set=set
ac_cv_env_target_alias_value=x86_64-linux-linux
ac_cv_path_install='/usr/bin/install -c'
ac_cv_prog_AWK=gawk
ac_cv_prog_ac_ct_CXX=g++
ac_cv_prog_make_make_set=yes

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

ACLOCAL='${SHELL} /usr/src/packages/BUILD/linux-cwc-0.8.7-2/bldconf/missing --run aclocal-1.9'
AMDEPBACKSLASH=''
AMDEP_FALSE=''
AMDEP_TRUE=''
AMTAR='${SHELL} /usr/src/packages/BUILD/linux-cwc-0.8.7-2/bldconf/missing --run tar'
AR=''
AUTOCONF='${SHELL} /usr/src/packages/BUILD/linux-cwc-0.8.7-2/bldconf/missing --run autoconf'
AUTOHEADER='${SHELL} /usr/src/packages/BUILD/linux-cwc-0.8.7-2/bldconf/missing --run autoheader'
AUTOMAKE='${SHELL} /usr/src/packages/BUILD/linux-cwc-0.8.7-2/bldconf/missing --run automake-1.9'
AWK='gawk'
CC=''
CCDEPMODE=''
CFLAGS=''
CPP=''
CPPFLAGS=''
CXX='g++'
CXXCPP=''
CXXDEPMODE=''
CXXFLAGS='-march=x86_64 -mtune=x86_64 -O2'
CYGPATH_W='echo'
DEBUG_FALSE=''
DEBUG_TRUE=''
DEFS=''
DEPDIR=''
DISTROVER_RHEL4_FALSE=''
DISTROVER_RHEL4_TRUE=''
DISTROVER_RHEL5_FALSE=''
DISTROVER_RHEL5_TRUE=''
DISTROVER_SLES10_FALSE=''
DISTROVER_SLES10_TRUE=''
DISTRO_ARCH_FALSE=''
DISTRO_ARCH_TRUE=''
DISTRO_DEBIAN_FALSE=''
DISTRO_DEBIAN_TRUE=''
DISTRO_GENTOO_FALSE=''
DISTRO_GENTOO_TRUE=''
DISTRO_REDHAT_FALSE=''
DISTRO_REDHAT_TRUE=''
DISTRO_SLACKWARE_FALSE=''
DISTRO_SLACKWARE_TRUE=''
DISTRO_SUSE_FALSE=''
DISTRO_SUSE_TRUE=''
ECHO='echo'
ECHO_C=''
ECHO_N='-n'
ECHO_T=''
EGREP=''
EXEEXT=''
F77=''
FFLAGS='-march=x86_64 -mtune=x86_64 -O2'
INSTALL_DATA='${INSTALL} -m 644'
INSTALL_PROGRAM='${INSTALL}'
INSTALL_SCRIPT='${INSTALL}'
INSTALL_STRIP_PROGRAM='${SHELL} $(install_sh) -c -s'
LDFLAGS=''
LIBCURL=''
LIBCURL_CPPFLAGS=''
LIBOBJS=''
LIBS=''
LIBTOOL=''
LN_S=''
LTLIBOBJS=''
MAKEINFO='${SHELL} /usr/src/packages/BUILD/linux-cwc-0.8.7-2/bldconf/missing --run makeinfo'
OBJEXT=''
PACKAGE='linux-cwc'
PACKAGE_NAME='linux-cwc'
PACKAGE_STRING='linux-cwc 0.8.7'
PACKAGE_TARNAME='linux-cwc'
PACKAGE_VERSION='0.8.7'
PATH_SEPARATOR=':'
RANLIB=''
SET_MAKE=''
SHELL='/bin/sh'
STRIP=''
VERSION='0.8.7'
WITH_NSSWITCH_FALSE=''
WITH_NSSWITCH_TRUE=''
WITH_PAM_SAMBA_FALSE=''
WITH_PAM_SAMBA_TRUE=''
WITH_PAM_SSHD_FALSE=''
WITH_PAM_SSHD_TRUE=''
_libcurl_config=''
ac_ct_AR=''
ac_ct_CC=''
ac_ct_CXX='g++'
ac_ct_F77=''
ac_ct_RANLIB=''
ac_ct_STRIP=''
am__fastdepCC_FALSE=''
am__fastdepCC_TRUE=''
am__fastdepCXX_FALSE=''
am__fastdepCXX_TRUE=''
am__include=''
am__leading_dot='.'
am__quote=''
am__tar='${AMTAR} chof - "$$tardir"'
am__untar='${AMTAR} xf -'
bindir='//bin'
build='x86_64-pc-linux-gnu'
build_alias='x86_64-pc-linux-gnu'
build_cpu=''
build_os=''
build_vendor=''
datadir='//share'
exec_prefix='/'
host='x86_64-pc-linux-gnu'
host_alias='x86_64-pc-linux-gnu'
host_cpu=''
host_os=''
host_vendor=''
includedir='//include'
infodir='//share/info'
install_sh='/usr/src/packages/BUILD/linux-cwc-0.8.7-2/bldconf/install-sh'
libdir='//lib64'
libexecdir='//lib64'
localstatedir='/var'
mandir='//share/man'
mkdir_p='mkdir -p --'
oldincludedir='/usr/include'
prefix='/'
program_transform_name='s,^,,'
sbindir='//sbin'
sharedstatedir='//com'
sysconfdir='/etc'
target_alias='x86_64-linux-linux'

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

#define PACKAGE "linux-cwc"
#define PACKAGE_NAME "linux-cwc"
#define PACKAGE_STRING "linux-cwc 0.8.7"
#define PACKAGE_TARNAME "linux-cwc"
#define PACKAGE_VERSION "0.8.7"
#define VERSION "0.8.7"

configure: exit 77
 
A

Anonymous

Gast
root me schrieb:
$ ./configure --host=x86_64-pc-linux-gnu --build=x86_64-pc-linux-gnu --target=x86_64-linux-linux --program-prefix= --prefix=/ --exec-prefix=/ --bindir=//bin --sbindir=//sbin --sysconfdir=/etc --datadir=//share --includedir=//include --libdir=//lib64 --libexecdir=//lib64 --localstatedir=/var --sharedstatedir=//com --mandir=//share/man --infodir=//share/info --with-pam-sshd --with-pam-samba --with-nsswitch

kommt dieser configure Aufruf von dir oder hat den sich configure irgendwie selbst aus defaults selbst erstellt?

Fehler ist folgendes
Code:
g++ -march=x86_64 .......
der Compiler würde aber nur folgendes sauber erkennen.
Code:
g++ -march=x86-64

Die Manpage kennt diesen CPU-Type auch nicht.
Code:
# man g++ | grep x86_64 | wc -l
0
# man g++ | grep x86-64 | wc -l
20


setze mal in configure Aufruf spaßenshalber
Code:
.....--host=x86-64-pc-linux-gnu --build=x86-64-pc-linux-gnu --target=x86-64-linux-linux......

Das Internet ist voll von diesem Fehler zB https://partner-bugzilla.redhat.com/show_bug.cgi?id=185507


robi
 
Hi,

drcux schrieb:
Kannst du mal nen Link zu dem src rpm geben?
das Paket kann ich leider nicht rausgeben, da es unternehmensbezogene Daten enthält.

robi schrieb:
kommt dieser configure Aufruf von dir oder hat den sich configure irgendwie selbst aus defaults selbst erstellt?
Ich führe nur den rpmbuild-Command aus, das Projektverzeichnis innerhalb von BUILD und die dort ebenfalls enthaltene config.log wird automatisch erzeugt.

Danke dir auf jeden Fall schonmal für den Hinweis, was da schief läuft!

robi schrieb:
setze mal in configure Aufruf spaßenshalber
Code:
.....--host=x86-64-pc-linux-gnu --build=x86-64-pc-linux-gnu --target=x86-64-linux-linux......

Meinst du im SPEC-File?
Dort wird nämlich eine Variable target_cpu auf folgende Weise definiert:
Code:
%define target_cpu %(uname-p)
Dies manuell ausgeführt ergibt auch die underscore-Schreibweise der CPU.
Ein späterer define setzt dann folgendes:
Code:
%define optflags -march=%{target_cpu} -mtune=%{target_cpu} -02
Das werde ich jetzt mal manuell anpassen und sehen was passiert. Falls es nicht klappt melde ich mich wieder.
 
Ok durch das manuelle Setzen von x86-64 kommt rpmbuilt schon ein paar Zeilen weiter, nur um bei einem ähnlichen Problem zu hängen.
Code:
checking for C++ compiler default output file name... a.out
checking whether the C++ compiler works... yes
checking whether we are cross compiling... no
checking for suffix of executables...
checking for suffix of object files... o
checking whether we are using the GNU C++ compiler... yes
checking whether g++ accepts -g... yes
checking for style of include used by make... GNU
checking dependency style of g++... gcc3
checking for x86-64-pc-linux-gnu-gcc... no
checking for gcc... gcc
checking whether we are using the GNU C compiler... yes
checking whether gcc accepts -g... yes
checking for gcc option to accept ANSI C... none needed
checking dependency style of gcc... gcc3
checking for a BSD-compatible install... /usr/bin/install -c
checking build system type... Invalid configuration `x86-64-pc-linux-gnu': machine `x86-64-pc' not recognized
configure: error: /bin/sh bldconf/config.sub x86-64-pc-linux-gnu failed
error: Bad exit status from /var/tmp/rpm-tmp.46304 (%build)

Also ist beim System-Type wieder die underscore-Schreibweise erforderlich, oder wie ist das zu verstehen?
Ich weiss nicht so recht, was ich jetzt noch anpassen soll. Anbei die defines, vielleicht könnt ihr mir helfen.
Code:
# Define the CPU and platform we are building (so we can build x86 and x86_64
%define target_cpu x86-64 # von mir manuell angepasst!
%define target gnu
%define target_os linux

## Override any system rpm macros
#
%define _arch %{target_cpu}
%define _build_arch %{target_cpu}
%define _vendor %{target_os}
%define _host %{target_cpu}-pc-%{target_os}-%{target}
%define _host_cpu %{target_cpu}
%define _host_vendor %{target_os}
%define optflags -march=%{target_cpu} -mtune=%{target_cpu} -O2
 
A

Anonymous

Gast
In der Endkonsequenz muss da ein neues configure Script hin, oder für 32bit compilieren Alles andere ist Friemelei mit ungewissen Ausgang. Das configure-Script ist mit automake 2.59 erstellt, dieses stammt vom 16-Dec-2003 . (aktuell währe 2.68) Damit wird ganz schnell klar, warum das nicht sauber funktioniert. ;) ;) ;) ;) ;)

Entweder den finden der das Paket gepackt hat, und diesen veranlassen das Paket mal zu überarbeiten. Oder falls dieser nicht aufzutreiben ist, dann brauchst du entweder einen Entwickler in eurer Firma der das kann, oder zumindestens mal einen Rechner auf dem du eine aktuelle Entwicklungsumgebung drauf hast. Mit etwas Glück sollte der ursprüngliche Entwickler/Packer die makefile.am und configure.in Files im Quelltext belassen haben, dann schafft das jeder Entwickler in ein paar Minuten das Paket neu zu packen.

Wenn der Quelltext jedoch auch so alt ist, dann wirds eventuell bei 64bit es noch einige weitere Überraschungen geben. ;)

robi
 
Hey robi,

danke für die klaren Worte. Ich glaube du hast recht, um das alte und untransparente SPEC-File hinzubiegen, wäre der Zeitaufwand einfach zu hoch und ich müsste hier zu oft nachharken :)
Der Entwickler ist leider nicht mehr im Unternehmen, auch sonst niemand der weiterhelfen kann. Einen Versuch auf einer RHEL-Maschine (32bit) fand schon statt. Dort läuft es zwar aufgrund einer falschen Bennenung des Source-Pakets im configure-Call auch noch nicht ganz durch, aber kommt doch schon um einiges weiter. Dann werde ich jetzt einen OS-Wechsel auf Red Hat anstreben und mir wohl ein Red Hat Forum suchen müssen ;)

Also danke nochmal!
 
Oben