Failure building mozjs52 with gold
I tried to build gnome-sdk-master on top of 1.8, and when building mozjs52 with gold i got issues during configure which seem to indicate gold doesn't quite work.
Disabling gold made it work. Here is the branch that reproduce this (if you drop the commit that disables gold): https://gitlab.gnome.org/GNOME/gnome-sdk-images/tree/rebase-on-1.8
Here is a snipped from the failed js/src/config.log:
This file contains any messages produced by compilers while
running configure, to aid debugging if configure makes a mistake.
configure:739: checking host system type
configure:760: checking target system type
configure:778: checking build system type
configure:1932: checking for gcc
configure:2045: checking whether the C compiler (/run/ccache/bin/gcc -std=gnu99 -O2 -g -fstack-protector-strong -fstack-protector-strong -Wl,-z,relro,-z,now) works
configure:2061: /run/ccache/bin/gcc -std=gnu99 -o conftest -O2 -g -fstack-protector-strong -O2 -D_FORTIFY_SOURCE=2 -fstack-protector-strong -Wl,-z,relro,-z,now conftest.c 1>&5
configure:2058:1: warning: return type defaults to 'int' [-Wimplicit-int]
configure:2087: checking whether the C compiler (/run/ccache/bin/gcc -std=gnu99 -O2 -g -fstack-protector-strong -fstack-protector-strong -Wl,-z,relro,-z,now) is a cross-compiler
configure:2092: checking whether we are using GNU C
configure:2101: /run/ccache/bin/gcc -std=gnu99 -E conftest.c
configure:2120: checking whether /run/ccache/bin/gcc -std=gnu99 accepts -g
configure:2156: checking for c++
configure:2188: checking whether the C++ compiler (/run/ccache/bin/g++ -std=gnu++11 -O2 -g -fstack-protector-strong -fstack-protector-strong -Wl,-z,relro,-z,now) works
configure:2204: /run/ccache/bin/g++ -std=gnu++11 -o conftest -O2 -g -fstack-protector-strong -O2 -D_FORTIFY_SOURCE=2 -fstack-protector-strong -Wl,-z,relro,-z,now conftest.C 1>&5
configure:2230: checking whether the C++ compiler (/run/ccache/bin/g++ -std=gnu++11 -O2 -g -fstack-protector-strong -fstack-protector-strong -Wl,-z,relro,-z,now) is a cross-compiler
configure:2235: checking whether we are using GNU C++
configure:2244: /run/ccache/bin/g++ -std=gnu++11 -E conftest.C
configure:2263: checking whether /run/ccache/bin/g++ -std=gnu++11 accepts -g
configure:2297: checking for ranlib
configure:2329: checking for as
configure:2383: checking for ar
configure:2418: checking for ld
configure:2453: checking for strip
configure:2488: checking for windres
configure:2907: checking for sb-conf
configure:2907: checking for ve
configure:3034: checking for X
configure:3101: /run/ccache/bin/gcc -E -std=gnu99 -O2 -D_FORTIFY_SOURCE=2 conftest.c >/dev/null 2>conftest.out
configure:3177: /run/ccache/bin/gcc -std=gnu99 -o conftest -O2 -g -fstack-protector-strong -O2 -D_FORTIFY_SOURCE=2 -fstack-protector-strong -Wl,-z,relro,-z,now conftest.c -lXt 1>&5
configure: In function 'main':
configure:3173:1: warning: implicit declaration of function 'XtMalloc' [-Wimplicit-function-declaration]
configure:3351: checking for dnet_ntoa in -ldnet
configure:3370: /run/ccache/bin/gcc -std=gnu99 -o conftest -O2 -g -fstack-protector-strong -O2 -D_FORTIFY_SOURCE=2 -fstack-protector-strong -Wl,-z,relro,-z,now conftest.c -ldnet 1>&5
/usr/lib/gcc/x86_64-unknown-linux-gnu/7.3.0/../../../../x86_64-unknown-linux-gnu/bin/ld: cannot find -ldnet
collect2: error: ld returned 1 exit status
configure: failed program was:
#line 3359 "configure"
#include "confdefs.h"
/* Override any gcc2 internal prototype to avoid an error. */
/* We use char because int might match the return type of a gcc2
builtin and then its argument prototype would still apply. */
char dnet_ntoa();
int main() {
dnet_ntoa()
; return 0; }
configure:3392: checking for dnet_ntoa in -ldnet_stub
configure:3411: /run/ccache/bin/gcc -std=gnu99 -o conftest -O2 -g -fstack-protector-strong -O2 -D_FORTIFY_SOURCE=2 -fstack-protector-strong -Wl,-z,relro,-z,now conftest.c -ldnet_stub 1>&5
/usr/lib/gcc/x86_64-unknown-linux-gnu/7.3.0/../../../../x86_64-unknown-linux-gnu/bin/ld: cannot find -ldnet_stub
collect2: error: ld returned 1 exit status
configure: failed program was:
#line 3400 "configure"
#include "confdefs.h"
/* Override any gcc2 internal prototype to avoid an error. */
/* We use char because int might match the return type of a gcc2
builtin and then its argument prototype would still apply. */
char dnet_ntoa();
int main() {
dnet_ntoa()
; return 0; }
configure:3440: checking for gethostbyname
configure:3472: /run/ccache/bin/gcc -std=gnu99 -o conftest -O2 -g -fstack-protector-strong -O2 -D_FORTIFY_SOURCE=2 -fstack-protector-strong -Wl,-z,relro,-z,now conftest.c 1>&5
configure:3542: checking for connect
configure:3574: /run/ccache/bin/gcc -std=gnu99 -o conftest -O2 -g -fstack-protector-strong -O2 -D_FORTIFY_SOURCE=2 -fstack-protector-strong -Wl,-z,relro,-z,now conftest.c 1>&5
configure:3638: checking for remove
configure:3670: /run/ccache/bin/gcc -std=gnu99 -o conftest -O2 -g -fstack-protector-strong -O2 -D_FORTIFY_SOURCE=2 -fstack-protector-strong -Wl,-z,relro,-z,now conftest.c 1>&5
configure:3734: checking for shmat
configure:3766: /run/ccache/bin/gcc -std=gnu99 -o conftest -O2 -g -fstack-protector-strong -O2 -D_FORTIFY_SOURCE=2 -fstack-protector-strong -Wl,-z,relro,-z,now conftest.c 1>&5
configure:3839: checking for IceConnectionNumber in -lICE
configure:3858: /run/ccache/bin/gcc -std=gnu99 -o conftest -O2 -g -fstack-protector-strong -O2 -D_FORTIFY_SOURCE=2 -fstack-protector-strong -Wl,-z,relro,-z,now conftest.c -lICE 1>&5
configure:4089: /run/ccache/bin/gcc -std=gnu99 -c -O2 -D_FORTIFY_SOURCE=2 conftest.c 1>&5
configure: In function 'main':
configure:4085:15: error: '__thumb2__' undeclared (first use in this function); did you mean '__unix__'?
configure:4085:15: note: each undeclared identifier is reported only once for each function it appears in
configure: failed program was:
#line 4082 "configure"
#include "confdefs.h"
int main() {
return sizeof(__thumb2__);
; return 0; }
configure:4754: /run/ccache/bin/gcc -std=gnu99 -o conftest -O2 -g -fstack-protector-strong -O2 -D_FORTIFY_SOURCE=2 -fstack-protector-strong -Wl,-z,relro,-z,now conftest.c 1>&5
configure:4784: checking for --noexecstack option to as
configure:4795: /run/ccache/bin/gcc -std=gnu99 -c -O2 -g -fstack-protector-strong -Wa,--noexecstack -O2 -D_FORTIFY_SOURCE=2 conftest.c 1>&5
configure:4808: checking for -z noexecstack option to ld
configure:4819: /run/ccache/bin/gcc -std=gnu99 -o conftest -O2 -g -fstack-protector-strong -O2 -D_FORTIFY_SOURCE=2 -fstack-protector-strong -Wl,-z,relro,-z,now -Wl,-z,noexecstack conftest.c 1>&5
configure:4832: checking for -z text option to ld
configure:4843: /run/ccache/bin/gcc -std=gnu99 -o conftest -O2 -g -fstack-protector-strong -O2 -D_FORTIFY_SOURCE=2 -fstack-protector-strong -Wl,-z,relro,-z,now -Wl,-z,noexecstack -Wl,-z,text conftest.c 1>&5
configure:4857: checking for --build-id option to ld
configure:4868: /run/ccache/bin/gcc -std=gnu99 -o conftest -O2 -g -fstack-protector-strong -O2 -D_FORTIFY_SOURCE=2 -fstack-protector-strong -Wl,-z,relro,-z,now -Wl,-z,noexecstack -Wl,-z,text -Wl,--build-id conftest.c 1>&5
configure:5781: checking for working const
configure:5835: /run/ccache/bin/gcc -std=gnu99 -c -fno-lifetime-dse -O2 -g -fstack-protector-strong -fno-math-errno -O2 -D_FORTIFY_SOURCE=2 conftest.c 1>&5
configure:5861: checking for mode_t
configure:5899: checking for off_t
configure:5937: checking for pid_t
configure:5975: checking for size_t
configure:6025: checking for ssize_t
configure:6038: /run/ccache/bin/gcc -std=gnu99 -c -fno-lifetime-dse -O2 -g -fstack-protector-strong -fno-math-errno -O2 -D_FORTIFY_SOURCE=2 conftest.c 1>&5
configure:6081: checking whether 64-bits std::atomic requires -latomic
configure:6094: /run/ccache/bin/g++ -std=gnu++11 -o conftest -fno-lifetime-dse -O2 -g -fstack-protector-strong -fno-rtti -fno-exceptions -fno-math-errno -O2 -D_FORTIFY_SOURCE=2 -fstack-protector-strong -Wl,-z,relro,-z,now -Wl,-z,noexecstack -Wl,-z,text -Wl,--build-id -B /run/build-runtime/mozjs52/js/src/build/unix/gold conftest.C 1>&5
/run/build-runtime/mozjs52/js/src/build/unix/gold/ld: error: cannot find -lugin
/run/build-runtime/mozjs52/js/src/build/unix/gold/ld: error: cannot find -lugin-opt=/usr/libexec/gcc/x86_64-unknown-linux-gnu/7.3.0/lto-wrapper
/run/build-runtime/mozjs52/js/src/build/unix/gold/ld: error: cannot find -lugin-opt=-fresolution=/tmp/ccDSAUkY.res
/run/build-runtime/mozjs52/js/src/build/unix/gold/ld: error: cannot find -lugin-opt=-pass-through=-lgcc_s
/run/build-runtime/mozjs52/js/src/build/unix/gold/ld: error: cannot find -lugin-opt=-pass-through=-lgcc
/run/build-runtime/mozjs52/js/src/build/unix/gold/ld: error: cannot find -lugin-opt=-pass-through=-lc
/run/build-runtime/mozjs52/js/src/build/unix/gold/ld: error: cannot find -lugin-opt=-pass-through=-lgcc_s
/run/build-runtime/mozjs52/js/src/build/unix/gold/ld: error: cannot find -lugin-opt=-pass-through=-lgcc
collect2: error: ld returned 1 exit status
configure: failed program was:
#line 6086 "configure"
#include "confdefs.h"
#include <cstdint>
#include <atomic>
int main() {
std::atomic<uint64_t> foo; foo = 1;
; return 0; }
configure:6112: /run/ccache/bin/g++ -std=gnu++11 -o conftest -fno-lifetime-dse -O2 -g -fstack-protector-strong -fno-rtti -fno-exceptions -fno-math-errno -O2 -D_FORTIFY_SOURCE=2 -fstack-protector-strong -Wl,-z,relro,-z,now -Wl,-z,noexecstack -Wl,-z,text -Wl,--build-id -B /run/build-runtime/mozjs52/js/src/build/unix/gold conftest.C -latomic 1>&5
/run/build-runtime/mozjs52/js/src/build/unix/gold/ld: error: cannot find -lugin
/run/build-runtime/mozjs52/js/src/build/unix/gold/ld: error: cannot find -lugin-opt=/usr/libexec/gcc/x86_64-unknown-linux-gnu/7.3.0/lto-wrapper
/run/build-runtime/mozjs52/js/src/build/unix/gold/ld: error: cannot find -lugin-opt=-fresolution=/tmp/ccillkP4.res
/run/build-runtime/mozjs52/js/src/build/unix/gold/ld: error: cannot find -lugin-opt=-pass-through=-lgcc_s
/run/build-runtime/mozjs52/js/src/build/unix/gold/ld: error: cannot find -lugin-opt=-pass-through=-lgcc
/run/build-runtime/mozjs52/js/src/build/unix/gold/ld: error: cannot find -lugin-opt=-pass-through=-lc
/run/build-runtime/mozjs52/js/src/build/unix/gold/ld: error: cannot find -lugin-opt=-pass-through=-lgcc_s
/run/build-runtime/mozjs52/js/src/build/unix/gold/ld: error: cannot find -lugin-opt=-pass-through=-lgcc
collect2: error: ld returned 1 exit status
configure: failed program was:
#line 6104 "configure"
#include "confdefs.h"
#include <cstdint>
#include <atomic>
int main() {
std::atomic<uint64_t> foo; foo = 1;
; return 0; }
configure:6160: checking for dirent.h that defines DIR
configure:6173: /run/ccache/bin/gcc -std=gnu99 -c -fno-lifetime-dse -O2 -g -fstack-protector-strong -fno-math-errno -O2 -D_FORTIFY_SOURCE=2 conftest.c 1>&5
configure:6201: checking for opendir in -ldir
configure:6220: /run/ccache/bin/gcc -std=gnu99 -o conftest -fno-lifetime-dse -O2 -g -fstack-protector-strong -fno-math-errno -O2 -D_FORTIFY_SOURCE=2 -fstack-protector-strong -Wl,-z,relro,-z,now -Wl,-z,noexecstack -Wl,-z,text -Wl,--build-id -B /run/build-runtime/mozjs52/js/src/build/unix/gold conftest.c -ldir 1>&5
/run/build-runtime/mozjs52/js/src/build/unix/gold/ld: error: cannot find -lugin
/run/build-runtime/mozjs52/js/src/build/unix/gold/ld: error: cannot find -lugin-opt=/usr/libexec/gcc/x86_64-unknown-linux-gnu/7.3.0/lto-wrapper
/run/build-runtime/mozjs52/js/src/build/unix/gold/ld: error: cannot find -lugin-opt=-fresolution=/tmp/cc9799Vb.res
/run/build-runtime/mozjs52/js/src/build/unix/gold/ld: error: cannot find -lugin-opt=-pass-through=-lgcc
/run/build-runtime/mozjs52/js/src/build/unix/gold/ld: error: cannot find -lugin-opt=-pass-through=-lgcc_s
/run/build-runtime/mozjs52/js/src/build/unix/gold/ld: error: cannot find -lugin-opt=-pass-through=-lc
/run/build-runtime/mozjs52/js/src/build/unix/gold/ld: error: cannot find -lugin-opt=-pass-through=-lgcc
/run/build-runtime/mozjs52/js/src/build/unix/gold/ld: error: cannot find -lugin-opt=-pass-through=-lgcc_s
/run/build-runtime/mozjs52/js/src/build/unix/gold/ld: error: cannot find -ldir
collect2: error: ld returned 1 exit status
configure: failed program was:
#line 6209 "configure"
#include "confdefs.h"
/* Override any gcc2 internal prototype to avoid an error. */
/* We use char because int might match the return type of a gcc2
builtin and then its argument prototype would still apply. */
char opendir();
int main() {
opendir()
; return 0; }
configure:6353: checking for gethostbyname_r in -lc_r
configure:6372: /run/ccache/bin/gcc -std=gnu99 -o conftest -fno-lifetime-dse -O2 -g -fstack-protector-strong -fno-math-errno -O2 -D_FORTIFY_SOURCE=2 -fstack-protector-strong -Wl,-z,relro,-z,now -Wl,-z,noexecstack -Wl,-z,text -Wl,--build-id -B /run/build-runtime/mozjs52/js/src/build/unix/gold conftest.c -lc_r 1>&5
/run/build-runtime/mozjs52/js/src/build/unix/gold/ld: error: cannot find -lugin
/run/build-runtime/mozjs52/js/src/build/unix/gold/ld: error: cannot find -lugin-opt=/usr/libexec/gcc/x86_64-unknown-linux-gnu/7.3.0/lto-wrapper
/run/build-runtime/mozjs52/js/src/build/unix/gold/ld: error: cannot find -lugin-opt=-fresolution=/tmp/ccQSOhxe.res
/run/build-runtime/mozjs52/js/src/build/unix/gold/ld: error: cannot find -lugin-opt=-pass-through=-lgcc
/run/build-runtime/mozjs52/js/src/build/unix/gold/ld: error: cannot find -lugin-opt=-pass-through=-lgcc_s
/run/build-runtime/mozjs52/js/src/build/unix/gold/ld: error: cannot find -lugin-opt=-pass-through=-lc
/run/build-runtime/mozjs52/js/src/build/unix/gold/ld: error: cannot find -lugin-opt=-pass-through=-lgcc
/run/build-runtime/mozjs52/js/src/build/unix/gold/ld: error: cannot find -lugin-opt=-pass-through=-lgcc_s
/run/build-runtime/mozjs52/js/src/build/unix/gold/ld: error: cannot find -lc_r
collect2: error: ld returned 1 exit status
configure: failed program was:
#line 6361 "configure"
#include "confdefs.h"
/* Override any gcc2 internal prototype to avoid an error. */
/* We use char because int might match the return type of a gcc2
builtin and then its argument prototype would still apply. */
char gethostbyname_r();
int main() {
gethostbyname_r()
; return 0; }