Hi guys,
bootstrapping a glibc-2.5-based system on x86_64-linux works fine, but
it doesn't work for i686-linux, because gmpxx cannot be built, which is
required for gcc 4.5.1 via ppl. Duh. :-(
The problem is that the version of g++ that's part of bootstrap-tools
doesn't work with glibc 2.5. The binaries it generates cannot be run:
./a.out: symbol lookup error:
/t/nix/.store/xxnnbk2s289lq8mmfj4q887fgz6y9bsf-bootstrap-tools/lib/libstdc++.so.6:
undefined symbol:
_ZNSt7num_getIcSt19istreambuf_iteratorIcSt11char_traitsIcEEE2idE,
version GLIBCXX_3.4
This causes the configure stage of gmpxx to fail. A complete config.log
is attached below.
Does anyone have an idea how that problem might be remedied?
Take care,
Peter
This file contains any messages produced by compilers while
running configure, to aid debugging if configure makes a mistake.
It was created by GNU MP configure 4.3.2, which was
generated by GNU Autoconf 2.61. Invocation command line was
$ ./configure
--prefix=/t/nix/.store/fgh5ffzj62d70bfrizfdj2947isan1br-gmp-4.3.2 --enable-cxx
--enable-static --disable-shared
## --------- ##
## Platform. ##
## --------- ##
hostname = detox
uname -m = i686
uname -r = 2.6.18-164.el5
uname -s = Linux
uname -v = #1 SMP Thu Sep 3 03:33:56 EDT 2009
/usr/bin/uname -p = unknown
/bin/uname -X = unknown
/bin/arch = i686
/usr/bin/arch -k = unknown
/usr/convex/getsysinfo = unknown
/usr/bin/hostinfo = unknown
/bin/machine = unknown
/usr/bin/oslevel = unknown
/bin/universe = unknown
PATH: /t/nix/.store/cmpkn3invr7flsg2jv14fl0xcrxg40yr-gnum4-1.4.15/bin
PATH: /t/nix/.store/xrys10vs7vqfk36wsjy4c8gfk1ayl0dp-bootstrap-gcc-wrapper/bin
PATH: /t/nix/.store/xxnnbk2s289lq8mmfj4q887fgz6y9bsf-bootstrap-tools/bin
PATH: /t/nix/.store/xxnnbk2s289lq8mmfj4q887fgz6y9bsf-bootstrap-tools/bin
PATH: /t/nix/.store/32sh3svvz3gh8jn2q2n4n1bxq3pw4y0m-binutils-2.21/bin
PATH: /t/nix/.store/ik2cxp10rix9y7lqdg2vc11ca7km3pz5-glibc-2.5/bin
PATH: /t/nix/.store/xxnnbk2s289lq8mmfj4q887fgz6y9bsf-bootstrap-tools/bin
## ----------- ##
## Core tests. ##
## ----------- ##
configure:2123: checking build system type
configure:2141: result: i686-pc-linux-gnu
configure:2163: checking host system type
configure:2178: result: i686-pc-linux-gnu
configure:2215: checking for a BSD-compatible install
configure:2271: result:
/t/nix/.store/xxnnbk2s289lq8mmfj4q887fgz6y9bsf-bootstrap-tools/bin/install -c
configure:2282: checking whether build environment is sane
configure:2325: result: yes
configure:2382: checking for gawk
configure:2398: found
/t/nix/.store/xxnnbk2s289lq8mmfj4q887fgz6y9bsf-bootstrap-tools/bin/gawk
configure:2409: result: gawk
configure:2420: checking whether make sets $(MAKE)
configure:2441: result: yes
configure:2623: checking whether to enable maintainer-specific portions of
Makefiles
configure:2632: result: no
User:
ABI=
CC=
CFLAGS=(unset)
CPPFLAGS=(unset)
MPN_PATH=
GMP:
abilist=32
cclist=gcc icc cc
configure:4346: gcc 2>&1 | grep xlc >/dev/null
configure:4349: $? = 1
configure:4403: checking compiler gcc -m32 -O2 -pedantic -fomit-frame-pointer
Test compile:
configure:4417: gcc -m32 -O2 -pedantic -fomit-frame-pointer conftest.c >&5
configure:4420: $? = 0
configure:4425: ./a.out || ./b.out || ./a.exe || ./a_out.exe || ./conftest
configure:4428: $? = 0
Test compile: function pointer return
configure:4471: gcc -m32 -O2 -pedantic -fomit-frame-pointer conftest.c >&5
configure:4474: $? = 0
configure:4479: ./a.out || ./b.out || ./a.exe || ./a_out.exe || ./conftest
configure:4482: $? = 0
Test compile: cmov instruction
configure:4527: gcc -m32 -O2 -pedantic -fomit-frame-pointer conftest.c >&5
configure:4530: $? = 0
configure:4535: ./a.out || ./b.out || ./a.exe || ./a_out.exe || ./conftest
configure:4538: $? = 0
Test compile: double -> ulong conversion
configure:4584: gcc -m32 -O2 -pedantic -fomit-frame-pointer conftest.c >&5
configure:4587: $? = 0
configure:4592: ./a.out || ./b.out || ./a.exe || ./a_out.exe || ./conftest
configure:4595: $? = 0
Test compile: double negation
configure:4639: gcc -m32 -O2 -pedantic -fomit-frame-pointer conftest.c >&5
configure:4642: $? = 0
configure:4647: ./a.out || ./b.out || ./a.exe || ./a_out.exe || ./conftest
configure:4650: $? = 0
Test compile: double -> float conversion
configure:4695: gcc -m32 -O2 -pedantic -fomit-frame-pointer conftest.c >&5
configure:4698: $? = 0
configure:4703: ./a.out || ./b.out || ./a.exe || ./a_out.exe || ./conftest
configure:4706: $? = 0
Test compile: gnupro alpha ev6 char spilling
configure:4780: gcc -m32 -O2 -pedantic -fomit-frame-pointer conftest.c >&5
configure:4783: $? = 0
configure:4788: ./a.out || ./b.out || ./a.exe || ./a_out.exe || ./conftest
configure:4791: $? = 0
Test compile: __builtin_alloca availability
configure:4831: gcc -m32 -O2 -pedantic -fomit-frame-pointer conftest.c >&5
/t/nix/.store/ik2cxp10rix9y7lqdg2vc11ca7km3pz5-glibc-2.5/lib/crt1.o: In
function `_start':
(.text+0x18): undefined reference to `main'
collect2: ld returned 1 exit status
configure:4834: $? = 1
failed program was:
int k; int foo () { __builtin_alloca (k); }
Test compile: abs int -> double conversion
configure:4955: gcc -m32 -O2 -pedantic -fomit-frame-pointer conftest.c >&5
configure:4958: $? = 0
configure:4963: ./a.out || ./b.out || ./a.exe || ./a_out.exe || ./conftest
configure:4966: $? = 0
Test compile: long long reliability test 1
configure:5019: gcc -m32 -O2 -pedantic -fomit-frame-pointer conftest.c >&5
conftest.c:6:23: warning: ISO C90 does not support 'long long'
configure:5022: $? = 0
configure:5027: ./a.out || ./b.out || ./a.exe || ./a_out.exe || ./conftest
configure:5030: $? = 0
Test compile: long long reliability test 2
configure:5079: gcc -m32 -O2 -pedantic -fomit-frame-pointer conftest.c >&5
conftest.c: In function 'f':
conftest.c:6:21: warning: ISO C90 does not support 'long long'
configure:5082: $? = 0
configure:5087: ./a.out || ./b.out || ./a.exe || ./a_out.exe || ./conftest
configure:5090: $? = 0
Test compile: mpn_lshift_com optimization
configure:5178: gcc -m32 -O2 -pedantic -fomit-frame-pointer conftest.c >&5
configure:5181: $? = 0
configure:5186: ./a.out || ./b.out || ./a.exe || ./a_out.exe || ./conftest
configure:5189: $? = 0
Test compile: mpn_lshift_com optimization 2
configure:5286: gcc -m32 -O2 -pedantic -fomit-frame-pointer conftest.c >&5
configure:5289: $? = 0
configure:5294: ./a.out || ./b.out || ./a.exe || ./a_out.exe || ./conftest
configure:5297: $? = 0
configure:5443: result: yes
configure: testlist sizeof-long-4
configure:5618: checking compiler gcc -m32 -O2 -pedantic -fomit-frame-pointer
has sizeof(long)==4
configure:5631: gcc -m32 -O2 -pedantic -fomit-frame-pointer -c conftest.c >&5
configure:5634: $? = 0
configure:5639: result: yes
configure:5912: checking compiler gcc -m32 -O2 -pedantic -fomit-frame-pointer
-mtune=pentiumpro
Test compile:
configure:5926: gcc -m32 -O2 -pedantic -fomit-frame-pointer -mtune=pentiumpro
conftest.c >&5
configure:5929: $? = 0
configure:5934: ./a.out || ./b.out || ./a.exe || ./a_out.exe || ./conftest
configure:5937: $? = 0
Test compile: function pointer return
configure:5980: gcc -m32 -O2 -pedantic -fomit-frame-pointer -mtune=pentiumpro
conftest.c >&5
configure:5983: $? = 0
configure:5988: ./a.out || ./b.out || ./a.exe || ./a_out.exe || ./conftest
configure:5991: $? = 0
Test compile: cmov instruction
configure:6036: gcc -m32 -O2 -pedantic -fomit-frame-pointer -mtune=pentiumpro
conftest.c >&5
configure:6039: $? = 0
configure:6044: ./a.out || ./b.out || ./a.exe || ./a_out.exe || ./conftest
configure:6047: $? = 0
Test compile: double -> ulong conversion
configure:6093: gcc -m32 -O2 -pedantic -fomit-frame-pointer -mtune=pentiumpro
conftest.c >&5
configure:6096: $? = 0
configure:6101: ./a.out || ./b.out || ./a.exe || ./a_out.exe || ./conftest
configure:6104: $? = 0
Test compile: double negation
configure:6148: gcc -m32 -O2 -pedantic -fomit-frame-pointer -mtune=pentiumpro
conftest.c >&5
configure:6151: $? = 0
configure:6156: ./a.out || ./b.out || ./a.exe || ./a_out.exe || ./conftest
configure:6159: $? = 0
Test compile: double -> float conversion
configure:6204: gcc -m32 -O2 -pedantic -fomit-frame-pointer -mtune=pentiumpro
conftest.c >&5
configure:6207: $? = 0
configure:6212: ./a.out || ./b.out || ./a.exe || ./a_out.exe || ./conftest
configure:6215: $? = 0
Test compile: gnupro alpha ev6 char spilling
configure:6289: gcc -m32 -O2 -pedantic -fomit-frame-pointer -mtune=pentiumpro
conftest.c >&5
configure:6292: $? = 0
configure:6297: ./a.out || ./b.out || ./a.exe || ./a_out.exe || ./conftest
configure:6300: $? = 0
Test compile: __builtin_alloca availability
configure:6340: gcc -m32 -O2 -pedantic -fomit-frame-pointer -mtune=pentiumpro
conftest.c >&5
/t/nix/.store/ik2cxp10rix9y7lqdg2vc11ca7km3pz5-glibc-2.5/lib/crt1.o: In
function `_start':
(.text+0x18): undefined reference to `main'
collect2: ld returned 1 exit status
configure:6343: $? = 1
failed program was:
int k; int foo () { __builtin_alloca (k); }
Test compile: abs int -> double conversion
configure:6464: gcc -m32 -O2 -pedantic -fomit-frame-pointer -mtune=pentiumpro
conftest.c >&5
configure:6467: $? = 0
configure:6472: ./a.out || ./b.out || ./a.exe || ./a_out.exe || ./conftest
configure:6475: $? = 0
Test compile: long long reliability test 1
configure:6528: gcc -m32 -O2 -pedantic -fomit-frame-pointer -mtune=pentiumpro
conftest.c >&5
conftest.c:6:23: warning: ISO C90 does not support 'long long'
configure:6531: $? = 0
configure:6536: ./a.out || ./b.out || ./a.exe || ./a_out.exe || ./conftest
configure:6539: $? = 0
Test compile: long long reliability test 2
configure:6588: gcc -m32 -O2 -pedantic -fomit-frame-pointer -mtune=pentiumpro
conftest.c >&5
conftest.c: In function 'f':
conftest.c:6:21: warning: ISO C90 does not support 'long long'
configure:6591: $? = 0
configure:6596: ./a.out || ./b.out || ./a.exe || ./a_out.exe || ./conftest
configure:6599: $? = 0
Test compile: mpn_lshift_com optimization
configure:6687: gcc -m32 -O2 -pedantic -fomit-frame-pointer -mtune=pentiumpro
conftest.c >&5
configure:6690: $? = 0
configure:6695: ./a.out || ./b.out || ./a.exe || ./a_out.exe || ./conftest
configure:6698: $? = 0
Test compile: mpn_lshift_com optimization 2
configure:6795: gcc -m32 -O2 -pedantic -fomit-frame-pointer -mtune=pentiumpro
conftest.c >&5
configure:6798: $? = 0
configure:6803: ./a.out || ./b.out || ./a.exe || ./a_out.exe || ./conftest
configure:6806: $? = 0
configure:6952: result: yes
configure:5912: checking compiler gcc -m32 -O2 -pedantic -fomit-frame-pointer
-mtune=pentiumpro -march=pentiumpro
Test compile:
configure:5926: gcc -m32 -O2 -pedantic -fomit-frame-pointer -mtune=pentiumpro
-march=pentiumpro conftest.c >&5
configure:5929: $? = 0
configure:5934: ./a.out || ./b.out || ./a.exe || ./a_out.exe || ./conftest
configure:5937: $? = 0
Test compile: function pointer return
configure:5980: gcc -m32 -O2 -pedantic -fomit-frame-pointer -mtune=pentiumpro
-march=pentiumpro conftest.c >&5
configure:5983: $? = 0
configure:5988: ./a.out || ./b.out || ./a.exe || ./a_out.exe || ./conftest
configure:5991: $? = 0
Test compile: cmov instruction
configure:6036: gcc -m32 -O2 -pedantic -fomit-frame-pointer -mtune=pentiumpro
-march=pentiumpro conftest.c >&5
configure:6039: $? = 0
configure:6044: ./a.out || ./b.out || ./a.exe || ./a_out.exe || ./conftest
configure:6047: $? = 0
Test compile: double -> ulong conversion
configure:6093: gcc -m32 -O2 -pedantic -fomit-frame-pointer -mtune=pentiumpro
-march=pentiumpro conftest.c >&5
configure:6096: $? = 0
configure:6101: ./a.out || ./b.out || ./a.exe || ./a_out.exe || ./conftest
configure:6104: $? = 0
Test compile: double negation
configure:6148: gcc -m32 -O2 -pedantic -fomit-frame-pointer -mtune=pentiumpro
-march=pentiumpro conftest.c >&5
configure:6151: $? = 0
configure:6156: ./a.out || ./b.out || ./a.exe || ./a_out.exe || ./conftest
configure:6159: $? = 0
Test compile: double -> float conversion
configure:6204: gcc -m32 -O2 -pedantic -fomit-frame-pointer -mtune=pentiumpro
-march=pentiumpro conftest.c >&5
configure:6207: $? = 0
configure:6212: ./a.out || ./b.out || ./a.exe || ./a_out.exe || ./conftest
configure:6215: $? = 0
Test compile: gnupro alpha ev6 char spilling
configure:6289: gcc -m32 -O2 -pedantic -fomit-frame-pointer -mtune=pentiumpro
-march=pentiumpro conftest.c >&5
configure:6292: $? = 0
configure:6297: ./a.out || ./b.out || ./a.exe || ./a_out.exe || ./conftest
configure:6300: $? = 0
Test compile: __builtin_alloca availability
configure:6340: gcc -m32 -O2 -pedantic -fomit-frame-pointer -mtune=pentiumpro
-march=pentiumpro conftest.c >&5
/t/nix/.store/ik2cxp10rix9y7lqdg2vc11ca7km3pz5-glibc-2.5/lib/crt1.o: In
function `_start':
(.text+0x18): undefined reference to `main'
collect2: ld returned 1 exit status
configure:6343: $? = 1
failed program was:
int k; int foo () { __builtin_alloca (k); }
Test compile: abs int -> double conversion
configure:6464: gcc -m32 -O2 -pedantic -fomit-frame-pointer -mtune=pentiumpro
-march=pentiumpro conftest.c >&5
configure:6467: $? = 0
configure:6472: ./a.out || ./b.out || ./a.exe || ./a_out.exe || ./conftest
configure:6475: $? = 0
Test compile: long long reliability test 1
configure:6528: gcc -m32 -O2 -pedantic -fomit-frame-pointer -mtune=pentiumpro
-march=pentiumpro conftest.c >&5
conftest.c:6:23: warning: ISO C90 does not support 'long long'
configure:6531: $? = 0
configure:6536: ./a.out || ./b.out || ./a.exe || ./a_out.exe || ./conftest
configure:6539: $? = 0
Test compile: long long reliability test 2
configure:6588: gcc -m32 -O2 -pedantic -fomit-frame-pointer -mtune=pentiumpro
-march=pentiumpro conftest.c >&5
conftest.c: In function 'f':
conftest.c:6:21: warning: ISO C90 does not support 'long long'
configure:6591: $? = 0
configure:6596: ./a.out || ./b.out || ./a.exe || ./a_out.exe || ./conftest
configure:6599: $? = 0
Test compile: mpn_lshift_com optimization
configure:6687: gcc -m32 -O2 -pedantic -fomit-frame-pointer -mtune=pentiumpro
-march=pentiumpro conftest.c >&5
configure:6690: $? = 0
configure:6695: ./a.out || ./b.out || ./a.exe || ./a_out.exe || ./conftest
configure:6698: $? = 0
Test compile: mpn_lshift_com optimization 2
configure:6795: gcc -m32 -O2 -pedantic -fomit-frame-pointer -mtune=pentiumpro
-march=pentiumpro conftest.c >&5
configure:6798: $? = 0
configure:6803: ./a.out || ./b.out || ./a.exe || ./a_out.exe || ./conftest
configure:6806: $? = 0
configure:6952: result: yes
configure:7103: checking for gcc
configure:7130: result: gcc
configure:7368: checking for C compiler version
configure:7375: gcc --version >&5
gcc (GCC) 4.5.1
Copyright (C) 2010 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:7378: $? = 0
configure:7385: gcc -v >&5
Using built-in specs.
COLLECT_GCC=/t/nix/.store/xxnnbk2s289lq8mmfj4q887fgz6y9bsf-bootstrap-tools/bin/gcc
COLLECT_LTO_WRAPPER=/t/nix/.store/xxnnbk2s289lq8mmfj4q887fgz6y9bsf-bootstrap-tools/bin/../libexec/gcc/i686-pc-linux-gnu/4.5.1/lto-wrapper
Target: i686-pc-linux-gnu
Configured with:
Thread model: posix
gcc version 4.5.1 (GCC)
configure:7388: $? = 0
configure:7395: gcc -V >&5
/t/nix/.store/xxnnbk2s289lq8mmfj4q887fgz6y9bsf-bootstrap-tools/bin/gcc: error
trying to exec
'/t/nix/.store/xxnnbk2s289lq8mmfj4q887fgz6y9bsf-bootstrap-tools/bin/i686-pc-linux-gnu-gcc--B/t/nix/.store/ik2cxp10rix9y7lqdg2vc11ca7km3pz5-glibc-2.5/lib/':
execvp: No such file or directory
configure:7398: $? = 0
configure:7421: checking for C compiler default output file name
configure:7448: gcc -m32 -O2 -pedantic -fomit-frame-pointer -mtune=pentiumpro
-march=pentiumpro conftest.c >&5
configure:7451: $? = 0
configure:7489: result: a.out
configure:7506: checking whether the C compiler works
configure:7516: ./a.out
configure:7519: $? = 0
configure:7536: result: yes
configure:7543: checking whether we are cross compiling
configure:7545: result: no
configure:7548: checking for suffix of executables
configure:7555: gcc -o conftest -m32 -O2 -pedantic -fomit-frame-pointer
-mtune=pentiumpro -march=pentiumpro conftest.c >&5
configure:7558: $? = 0
configure:7582: result:
configure:7588: checking for suffix of object files
configure:7614: gcc -c -m32 -O2 -pedantic -fomit-frame-pointer
-mtune=pentiumpro -march=pentiumpro conftest.c >&5
configure:7617: $? = 0
configure:7640: result: o
configure:7644: checking whether we are using the GNU C compiler
configure:7673: gcc -c -m32 -O2 -pedantic -fomit-frame-pointer
-mtune=pentiumpro -march=pentiumpro conftest.c >&5
configure:7679: $? = 0
configure:7696: result: yes
configure:7701: checking whether gcc accepts -g
configure:7731: gcc -c -g conftest.c >&5
configure:7737: $? = 0
configure:7836: result: yes
configure:7853: checking for gcc option to accept ISO C89
configure:7927: gcc -c -m32 -O2 -pedantic -fomit-frame-pointer
-mtune=pentiumpro -march=pentiumpro conftest.c >&5
configure:7933: $? = 0
configure:7956: result: none needed
configure:7976: checking for gcc option to accept ISO C99
configure:8135: gcc -c -m32 -O2 -pedantic -fomit-frame-pointer
-mtune=pentiumpro -march=pentiumpro conftest.c >&5
conftest.c:20:1: warning: C++ style comments are not allowed in ISO C90
conftest.c:20:1: warning: (this will be reported only once per input file)
conftest.c:21:15: warning: anonymous variadic macros were introduced in C99
conftest.c:22:18: warning: anonymous variadic macros were introduced in C99
conftest.c:23:21: warning: anonymous variadic macros were introduced in C99
conftest.c:39:6: warning: use of C99 long long integer constant
conftest.c:39:6: warning: use of C99 long long integer constant
conftest.c:39:6: warning: use of C99 long long integer constant
conftest.c:42:5: warning: use of C99 long long integer constant
conftest.c:42:5: warning: use of C99 long long integer constant
conftest.c:42:5: warning: use of C99 long long integer constant
conftest.c:46:13: warning: ISO C90 does not support 'long long'
conftest.c:46:32: warning: use of C99 long long integer constant
conftest.c:47:22: warning: ISO C90 does not support 'long long'
conftest.c:47:41: warning: use of C99 long long integer constant
conftest.c:52:10: warning: ISO C90 does not support flexible array members
conftest.c:64:29: error: expected ';', ',' or ')' before 'text'
conftest.c: In function 'test_varargs':
conftest.c:80:3: warning: ISO C90 forbids mixed declarations and code
conftest.c:83:3: warning: ISO C90 forbids mixed declarations and code
conftest.c: In function 'main':
conftest.c:118:3: warning: ISO C forbids nested functions
conftest.c:118:18: error: expected '=', ',', ';', 'asm' or '__attribute__'
before 'newvar'
conftest.c:118:3: warning: ISO C90 forbids mixed declarations and code
conftest.c:118:18: error: 'newvar' undeclared (first use in this function)
conftest.c:118:18: note: each undeclared identifier is reported only once for
each function it appears in
conftest.c:125:3: warning: ISO C90 forbids mixed declarations and code
conftest.c:128:3: error: 'for' loop initial declarations are only allowed in
C99 mode
conftest.c:128:3: note: use option -std=c99 or -std=gnu99 to compile your code
conftest.c:133:5: warning: ISO C90 forbids specifying subobject to initialize
conftest.c:134:5: warning: ISO C90 forbids specifying subobject to initialize
conftest.c:135:5: warning: ISO C90 forbids specifying subobject to initialize
conftest.c:132:3: warning: ISO C90 forbids mixed declarations and code
conftest.c:140:3: warning: ISO C90 forbids variable length array 'dynamic_array'
conftest.c:140:3: warning: ISO C90 forbids mixed declarations and code
conftest.c:144:33: warning: use of C99 long long integer constant
conftest.c:144:51: warning: use of C99 long long integer constant
configure:8141: $? = 1
configure: failed program was:
| /* confdefs.h. */
| #define PACKAGE_NAME "GNU MP"
| #define PACKAGE_TARNAME "gmp"
| #define PACKAGE_VERSION "4.3.2"
| #define PACKAGE_STRING "GNU MP 4.3.2"
| #define PACKAGE_BUGREPORT "[email protected]"
| #define PACKAGE "gmp"
| #define VERSION "4.3.2"
| #define WANT_FFT 1
| #define HAVE_HOST_CPU_i686 1
| #define HAVE_SPEED_CYCLECOUNTER 2
| #define HAVE_CALLING_CONVENTIONS 1
| /* end confdefs.h. */
| #include <stdarg.h>
| #include <stdbool.h>
| #include <stdlib.h>
| #include <wchar.h>
| #include <stdio.h>
|
| // Check varargs macros. These examples are taken from C99 6.10.3.5.
| #define debug(...) fprintf (stderr, __VA_ARGS__)
| #define showlist(...) puts (#__VA_ARGS__)
| #define report(test,...) ((test) ? puts (#test) : printf (__VA_ARGS__))
| static void
| test_varargs_macros (void)
| {
| int x = 1234;
| int y = 5678;
| debug ("Flag");
| debug ("X = %d\n", x);
| showlist (The first, second, and third items.);
| report (x>y, "x is %d but y is %d", x, y);
| }
|
| // Check long long types.
| #define BIG64 18446744073709551615ull
| #define BIG32 4294967295ul
| #define BIG_OK (BIG64 / BIG32 == 4294967297ull && BIG64 % BIG32 == 0)
| #if !BIG_OK
| your preprocessor is broken;
| #endif
| #if BIG_OK
| #else
| your preprocessor is broken;
| #endif
| static long long int bignum = -9223372036854775807LL;
| static unsigned long long int ubignum = BIG64;
|
| struct incomplete_array
| {
| int datasize;
| double data[];
| };
|
| struct named_init {
| int number;
| const wchar_t *name;
| double average;
| };
|
| typedef const char *ccp;
|
| static inline int
| test_restrict (ccp restrict text)
| {
| // See if C++-style comments work.
| // Iterate through items via the restricted pointer.
| // Also check for declarations in for loops.
| for (unsigned int i = 0; *(text+i) != '\0'; ++i)
| continue;
| return 0;
| }
|
| // Check varargs and va_copy.
| static void
| test_varargs (const char *format, ...)
| {
| va_list args;
| va_start (args, format);
| va_list args_copy;
| va_copy (args_copy, args);
|
| const char *str;
| int number;
| float fnumber;
|
| while (*format)
| {
| switch (*format++)
| {
| case 's': // string
| str = va_arg (args_copy, const char *);
| break;
| case 'd': // int
| number = va_arg (args_copy, int);
| break;
| case 'f': // float
| fnumber = va_arg (args_copy, double);
| break;
| default:
| break;
| }
| }
| va_end (args_copy);
| va_end (args);
| }
|
| int
| main ()
| {
|
| // Check bool.
| _Bool success = false;
|
| // Check restrict.
| if (test_restrict ("String literal") == 0)
| success = true;
| char *restrict newvar = "Another string";
|
| // Check varargs.
| test_varargs ("s, d' f .", "string", 65, 34.234);
| test_varargs_macros ();
|
| // Check flexible array members.
| struct incomplete_array *ia =
| malloc (sizeof (struct incomplete_array) + (sizeof (double) * 10));
| ia->datasize = 10;
| for (int i = 0; i < ia->datasize; ++i)
| ia->data[i] = i * 1.234;
|
| // Check named initializers.
| struct named_init ni = {
| .number = 34,
| .name = L"Test wide string",
| .average = 543.34343,
| };
|
| ni.number = 58;
|
| int dynamic_array[ni.number];
| dynamic_array[ni.number - 1] = 543;
|
| // work around unused variable warnings
| return (!success || bignum == 0LL || ubignum == 0uLL || newvar[0] == 'x'
| || dynamic_array[ni.number - 1] != 543);
|
| ;
| return 0;
| }
configure:8135: gcc -std=gnu99 -c -m32 -O2 -pedantic -fomit-frame-pointer
-mtune=pentiumpro -march=pentiumpro conftest.c >&5
configure:8141: $? = 0
configure:8171: result: -std=gnu99
configure:8301: checking for gcc -std=gnu99 option to accept ISO Standard C
configure:8312: result: -std=gnu99
configure:8322: checking how to run the C preprocessor
configure:8362: gcc -std=gnu99 -E conftest.c
configure:8368: $? = 0
configure:8399: gcc -std=gnu99 -E conftest.c
conftest.c:14:28: fatal error: ac_nonexistent.h: No such file or directory
compilation terminated.
configure:8405: $? = 1
configure: failed program was:
| /* confdefs.h. */
| #define PACKAGE_NAME "GNU MP"
| #define PACKAGE_TARNAME "gmp"
| #define PACKAGE_VERSION "4.3.2"
| #define PACKAGE_STRING "GNU MP 4.3.2"
| #define PACKAGE_BUGREPORT "[email protected]"
| #define PACKAGE "gmp"
| #define VERSION "4.3.2"
| #define WANT_FFT 1
| #define HAVE_HOST_CPU_i686 1
| #define HAVE_SPEED_CYCLECOUNTER 2
| #define HAVE_CALLING_CONVENTIONS 1
| /* end confdefs.h. */
| #include <ac_nonexistent.h>
configure:8438: result: gcc -std=gnu99 -E
configure:8467: gcc -std=gnu99 -E conftest.c
configure:8473: $? = 0
configure:8504: gcc -std=gnu99 -E conftest.c
conftest.c:14:28: fatal error: ac_nonexistent.h: No such file or directory
compilation terminated.
configure:8510: $? = 1
configure: failed program was:
| /* confdefs.h. */
| #define PACKAGE_NAME "GNU MP"
| #define PACKAGE_TARNAME "gmp"
| #define PACKAGE_VERSION "4.3.2"
| #define PACKAGE_STRING "GNU MP 4.3.2"
| #define PACKAGE_BUGREPORT "[email protected]"
| #define PACKAGE "gmp"
| #define VERSION "4.3.2"
| #define WANT_FFT 1
| #define HAVE_HOST_CPU_i686 1
| #define HAVE_SPEED_CYCLECOUNTER 2
| #define HAVE_CALLING_CONVENTIONS 1
| /* end confdefs.h. */
| #include <ac_nonexistent.h>
configure:8584: gcc -std=gnu99 -c -m32 -O2 -pedantic -fomit-frame-pointer
-mtune=pentiumpro -march=pentiumpro conftest.c >&5
configure:8590: $? = 0
configure:8682: checking build system compiler gcc -std=gnu99
configure:8695: gcc -std=gnu99 conftest.c
conftest.c: In function 'main':
conftest.c:4:3: warning: implicit declaration of function 'exit'
conftest.c:4:3: warning: incompatible implicit declaration of built-in function
'exit'
configure:8698: $? = 0
configure:8705: result: yes
configure:8726: checking for build system preprocessor
configure:8737: gcc -std=gnu99 -E conftest.c
# 1 "conftest.c"
# 1 "<built-in>"
# 1 "<command-line>"
# 1 "conftest.c"
configure:8740: $? = 0
configure:8757: result: gcc -std=gnu99 -E
configure:8764: checking for build system executable suffix
configure:8778: gcc -std=gnu99 conftest.c -o conftest.exe
conftest.c: In function 'main':
conftest.c:4:3: warning: implicit declaration of function 'exit'
conftest.c:4:3: warning: incompatible implicit declaration of built-in function
'exit'
configure:8781: $? = 0
./configure: line 8783: ./conftest: No such file or directory
configure:8778: gcc -std=gnu99 conftest.c -o conftest,ff8
conftest.c: In function 'main':
conftest.c:4:3: warning: implicit declaration of function 'exit'
conftest.c:4:3: warning: incompatible implicit declaration of built-in function
'exit'
configure:8781: $? = 0
./configure: line 8783: ./conftest: No such file or directory
configure:8778: gcc -std=gnu99 conftest.c -o conftest
conftest.c: In function 'main':
conftest.c:4:3: warning: implicit declaration of function 'exit'
conftest.c:4:3: warning: incompatible implicit declaration of built-in function
'exit'
configure:8781: $? = 0
configure:8797: result:
configure:8803: checking whether build system compiler is ANSI
configure:8816: gcc -std=gnu99 conftest.c
conftest.c: In function 'main':
conftest.c:4:3: warning: implicit declaration of function 'exit'
conftest.c:4:3: warning: incompatible implicit declaration of built-in function
'exit'
configure:8819: $? = 0
configure:8828: result: yes
configure:8838: checking for build system compiler math library
configure:8857: gcc -std=gnu99 conftest.c -lm
conftest.c: In function 'main':
conftest.c:4:3: warning: implicit declaration of function 'exit'
conftest.c:4:3: warning: incompatible implicit declaration of built-in function
'exit'
conftest.c: In function 'foo':
conftest.c:10:3: warning: implicit declaration of function 'log'
conftest.c:10:10: warning: incompatible implicit declaration of built-in
function 'log'
configure:8860: $? = 0
configure:8869: result: -lm
configure:8950: checking for g++
configure:8966: found
/t/nix/.store/xrys10vs7vqfk36wsjy4c8gfk1ayl0dp-bootstrap-gcc-wrapper/bin/g++
configure:8977: result: g++
configure:9008: checking for C++ compiler version
configure:9015: g++ --version >&5
g++ (GCC) 4.5.1
Copyright (C) 2010 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:9018: $? = 0
configure:9025: g++ -v >&5
Using built-in specs.
COLLECT_GCC=/t/nix/.store/xxnnbk2s289lq8mmfj4q887fgz6y9bsf-bootstrap-tools/bin/g++
COLLECT_LTO_WRAPPER=/t/nix/.store/xxnnbk2s289lq8mmfj4q887fgz6y9bsf-bootstrap-tools/bin/../libexec/gcc/i686-pc-linux-gnu/4.5.1/lto-wrapper
Target: i686-pc-linux-gnu
Configured with:
Thread model: posix
gcc version 4.5.1 (GCC)
configure:9028: $? = 0
configure:9035: g++ -V >&5
/t/nix/.store/xxnnbk2s289lq8mmfj4q887fgz6y9bsf-bootstrap-tools/bin/g++: error
trying to exec
'/t/nix/.store/xxnnbk2s289lq8mmfj4q887fgz6y9bsf-bootstrap-tools/bin/i686-pc-linux-gnu-gcc--B/t/nix/.store/ik2cxp10rix9y7lqdg2vc11ca7km3pz5-glibc-2.5/lib/':
execvp: No such file or directory
configure:9038: $? = 0
configure:9041: checking whether we are using the GNU C++ compiler
configure:9070: g++ -c conftest.cpp >&5
configure:9076: $? = 0
configure:9093: result: yes
configure:9098: checking whether g++ accepts -g
configure:9128: g++ -c -g conftest.cpp >&5
configure:9134: $? = 0
configure:9233: result: yes
CXXFLAGS chosen by autoconf: -g -O2
configure:9283: checking C++ compiler g++ -m32 -O2 -pedantic
-fomit-frame-pointer -mtune=pentiumpro -march=pentiumpro
Test compile:
configure:9297: g++ -m32 -O2 -pedantic -fomit-frame-pointer -mtune=pentiumpro
-march=pentiumpro conftest.cc >&5
configure:9300: $? = 0
configure:9304: ./a.out || ./b.out || ./a.exe || ./a_out.exe || ./conftest
./a.out: symbol lookup error:
/t/nix/.store/xxnnbk2s289lq8mmfj4q887fgz6y9bsf-bootstrap-tools/lib/libstdc++.so.6:
undefined symbol:
_ZNSt7num_getIcSt19istreambuf_iteratorIcSt11char_traitsIcEEE2idE, version
GLIBCXX_3.4
./configure: line 9305: ./b.out: No such file or directory
./configure: line 9305: ./a.exe: No such file or directory
./configure: line 9305: ./a_out.exe: No such file or directory
./configure: line 9305: ./conftest: No such file or directory
configure:9307: $? = 127
failed program was:
int main (void) { return 0; }
configure:9412: result: no, program does not run
configure:9283: checking C++ compiler g++ -g -O2
Test compile:
configure:9297: g++ -g -O2 conftest.cc >&5
configure:9300: $? = 0
configure:9304: ./a.out || ./b.out || ./a.exe || ./a_out.exe || ./conftest
./a.out: symbol lookup error:
/t/nix/.store/xxnnbk2s289lq8mmfj4q887fgz6y9bsf-bootstrap-tools/lib/libstdc++.so.6:
undefined symbol:
_ZNSt7num_getIcSt19istreambuf_iteratorIcSt11char_traitsIcEEE2idE, version
GLIBCXX_3.4
./configure: line 9305: ./b.out: No such file or directory
./configure: line 9305: ./a.exe: No such file or directory
./configure: line 9305: ./a_out.exe: No such file or directory
./configure: line 9305: ./conftest: No such file or directory
configure:9307: $? = 127
failed program was:
int main (void) { return 0; }
configure:9412: result: no, program does not run
configure:9428: error: C++ compiler not available, see config.log for details
## ---------------- ##
## Cache variables. ##
## ---------------- ##
ac_cv_build=i686-pc-linux-gnu
ac_cv_c_compiler_gnu=yes
ac_cv_cxx_compiler_gnu=yes
ac_cv_env_ABI_set=
ac_cv_env_ABI_value=
ac_cv_env_CCC_set=
ac_cv_env_CCC_value=
ac_cv_env_CC_FOR_BUILD_set=
ac_cv_env_CC_FOR_BUILD_value=
ac_cv_env_CC_set=
ac_cv_env_CC_value=
ac_cv_env_CFLAGS_set=
ac_cv_env_CFLAGS_value=
ac_cv_env_CPPFLAGS_set=
ac_cv_env_CPPFLAGS_value=
ac_cv_env_CPP_FOR_BUILD_set=
ac_cv_env_CPP_FOR_BUILD_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=
ac_cv_env_CXXFLAGS_value=
ac_cv_env_CXX_set=
ac_cv_env_CXX_value=
ac_cv_env_LDFLAGS_set=
ac_cv_env_LDFLAGS_value=
ac_cv_env_LIBS_set=
ac_cv_env_LIBS_value=
ac_cv_env_M4_set=
ac_cv_env_M4_value=
ac_cv_env_YACC_set=
ac_cv_env_YACC_value=
ac_cv_env_YFLAGS_set=
ac_cv_env_YFLAGS_value=
ac_cv_env_build_alias_set=
ac_cv_env_build_alias_value=
ac_cv_env_host_alias_set=
ac_cv_env_host_alias_value=
ac_cv_env_target_alias_set=
ac_cv_env_target_alias_value=
ac_cv_host=i686-pc-linux-gnu
ac_cv_objext=o
ac_cv_path_install='/t/nix/.store/xxnnbk2s289lq8mmfj4q887fgz6y9bsf-bootstrap-tools/bin/install
-c'
ac_cv_prog_AWK=gawk
ac_cv_prog_CPP='gcc -std=gnu99 -E'
ac_cv_prog_ac_ct_CC=gcc
ac_cv_prog_ac_ct_CXX=g++
ac_cv_prog_cc_c89=
ac_cv_prog_cc_c99=-std=gnu99
ac_cv_prog_cc_g=yes
ac_cv_prog_cc_stdc=-std=gnu99
ac_cv_prog_cxx_g=yes
ac_cv_prog_make_make_set=yes
gmp_cv_c_for_build_ansi=yes
gmp_cv_check_libm_for_build=-lm
gmp_cv_prog_cpp_for_build='gcc -std=gnu99 -E'
gmp_cv_prog_exeext_for_build=
## ----------------- ##
## Output variables. ##
## ----------------- ##
ABI='32'
ACLOCAL='${SHELL}
/tmp/nix-build-kfqr234yw4d4dva8b7m7wr8am9zmvbg9-gmp-4.3.2.drv-0/gmp-4.3.2/missing
--run aclocal-1.8'
AMTAR='${SHELL}
/tmp/nix-build-kfqr234yw4d4dva8b7m7wr8am9zmvbg9-gmp-4.3.2.drv-0/gmp-4.3.2/missing
--run tar'
ANSI2KNR=''
AR=''
AS=''
ASMFLAGS=''
AUTOCONF='${SHELL}
/tmp/nix-build-kfqr234yw4d4dva8b7m7wr8am9zmvbg9-gmp-4.3.2.drv-0/gmp-4.3.2/missing
--run autoconf'
AUTOHEADER='${SHELL}
/tmp/nix-build-kfqr234yw4d4dva8b7m7wr8am9zmvbg9-gmp-4.3.2.drv-0/gmp-4.3.2/missing
--run autoheader'
AUTOMAKE='${SHELL}
/tmp/nix-build-kfqr234yw4d4dva8b7m7wr8am9zmvbg9-gmp-4.3.2.drv-0/gmp-4.3.2/missing
--run automake-1.8'
AWK='gawk'
BITS_PER_MP_LIMB=''
CALLING_CONVENTIONS_OBJS='x86call.lo x86check$U.lo'
CC='gcc -std=gnu99'
CCAS='gcc -std=gnu99 -c'
CC_FOR_BUILD='gcc -std=gnu99'
CFLAGS='-m32 -O2 -pedantic -fomit-frame-pointer -mtune=pentiumpro
-march=pentiumpro'
CPP='gcc -std=gnu99 -E'
CPPFLAGS=''
CPP_FOR_BUILD='gcc -std=gnu99 -E'
CXX='g++'
CXXCPP=''
CXXFLAGS='-g -O2'
CYGPATH_W='echo'
DEFN_LONG_LONG_LIMB='/* #undef _LONG_LONG_LIMB */'
DEFS=''
DLLTOOL=''
ECHO='echo'
ECHO_C=''
ECHO_N='-n'
ECHO_T=''
EGREP=''
ENABLE_STATIC_FALSE=''
ENABLE_STATIC_TRUE=''
EXEEXT=''
EXEEXT_FOR_BUILD=''
GMP_LDFLAGS=''
GMP_NAIL_BITS='0'
GREP=''
HAVE_CLOCK_01=''
HAVE_CPUTIME_01=''
HAVE_GETRUSAGE_01=''
HAVE_GETTIMEOFDAY_01=''
HAVE_HOST_CPU_FAMILY_power='0'
HAVE_HOST_CPU_FAMILY_powerpc='0'
HAVE_SIGACTION_01=''
HAVE_SIGALTSTACK_01=''
HAVE_SIGSTACK_01=''
HAVE_STACK_T_01=''
HAVE_SYS_RESOURCE_H_01=''
INSTALL_DATA='${INSTALL} -m 644'
INSTALL_PROGRAM='${INSTALL}'
INSTALL_SCRIPT='${INSTALL}'
INSTALL_STRIP_PROGRAM='${SHELL} $(install_sh) -c -s'
LDFLAGS=''
LEX=''
LEXLIB=''
LEX_OUTPUT_ROOT=''
LIBCURSES=''
LIBGMPXX_LDFLAGS=''
LIBGMP_DLL=''
LIBGMP_LDFLAGS=''
LIBM=''
LIBM_FOR_BUILD='-lm'
LIBOBJS=''
LIBREADLINE=''
LIBS=''
LIBTOOL=''
LN_S=''
LTLIBOBJS=''
M4=''
MAINT='#'
MAINTAINER_MODE_FALSE=''
MAINTAINER_MODE_TRUE='#'
MAKEINFO='${SHELL}
/tmp/nix-build-kfqr234yw4d4dva8b7m7wr8am9zmvbg9-gmp-4.3.2.drv-0/gmp-4.3.2/missing
--run makeinfo'
OBJDUMP=''
OBJEXT='o'
PACKAGE='gmp'
PACKAGE_BUGREPORT='[email protected]'
PACKAGE_NAME='GNU MP'
PACKAGE_STRING='GNU MP 4.3.2'
PACKAGE_TARNAME='gmp'
PACKAGE_VERSION='4.3.2'
PATH_SEPARATOR=':'
RANLIB=''
SED=''
SET_MAKE=''
SHELL='/bin/sh'
SPEED_CYCLECOUNTER_OBJ='pentium.lo'
STRIP=''
TAL_OBJECT=''
TUNE_SQR_OBJ=''
U=''
U_FOR_BUILD=''
VERSION='4.3.2'
WANT_CXX_FALSE=''
WANT_CXX_TRUE=''
WANT_MPBSD_FALSE=''
WANT_MPBSD_TRUE='#'
WITH_READLINE_01=''
YACC=''
YFLAGS=''
ac_ct_CC='gcc'
ac_ct_CXX='g++'
am__leading_dot='.'
bindir='${exec_prefix}/bin'
build='i686-pc-linux-gnu'
build_alias=''
build_cpu='i686'
build_os='linux-gnu'
build_vendor='pc'
datadir='${datarootdir}'
datarootdir='${prefix}/share'
docdir='${datarootdir}/doc/${PACKAGE_TARNAME}'
dvidir='${docdir}'
exec_prefix='NONE'
gmp_srclinks=''
host='i686-pc-linux-gnu'
host_alias=''
host_cpu='i686'
host_os='linux-gnu'
host_vendor='pc'
htmldir='${docdir}'
includedir='${prefix}/include'
infodir='${datarootdir}/info'
install_sh='/tmp/nix-build-kfqr234yw4d4dva8b7m7wr8am9zmvbg9-gmp-4.3.2.drv-0/gmp-4.3.2/install-sh'
libdir='${exec_prefix}/lib'
libexecdir='${exec_prefix}/libexec'
localedir='${datarootdir}/locale'
localstatedir='${prefix}/var'
mandir='${datarootdir}/man'
mkdir_p='mkdir -p -- .'
mpn_objects=''
mpn_objs_in_libgmp=''
mpn_objs_in_libmp=''
oldincludedir='/usr/include'
pdfdir='${docdir}'
prefix='/t/nix/.store/fgh5ffzj62d70bfrizfdj2947isan1br-gmp-4.3.2'
program_transform_name='s,x,x,'
psdir='${docdir}'
sbindir='${exec_prefix}/sbin'
sharedstatedir='${prefix}/com'
sysconfdir='${prefix}/etc'
target_alias=''
## ----------- ##
## confdefs.h. ##
## ----------- ##
#define PACKAGE_NAME "GNU MP"
#define PACKAGE_TARNAME "gmp"
#define PACKAGE_VERSION "4.3.2"
#define PACKAGE_STRING "GNU MP 4.3.2"
#define PACKAGE_BUGREPORT "[email protected]"
#define PACKAGE "gmp"
#define VERSION "4.3.2"
#define WANT_FFT 1
#define HAVE_HOST_CPU_i686 1
#define HAVE_SPEED_CYCLECOUNTER 2
#define HAVE_CALLING_CONVENTIONS 1
configure: exit 1
_______________________________________________
nix-dev mailing list
[email protected]
https://mail.cs.uu.nl/mailman/listinfo/nix-dev