{"action":"created","issue":{"url":"https://api.github.com/repos/mhart/alpine-node/issues/31","repository_url":"https://api.github.com/repos/mhart/alpine-node","labels_url":"https://api.github.com/repos/mhart/alpine-node/issues/31/labels{/name}","comments_url":"https://api.github.com/repos/mhart/alpine-node/issues/31/comments","events_url":"https://api.github.com/repos/mhart/alpine-node/issues/31/events","html_url":"https://github.com/mhart/alpine-node/issues/31","id":147420104,"number":31,"title":"Rebuild fails: collect2: error: ld returned 1 exit status","user":{"login":"vortec","id":864772,"avatar_url":"https://avatars.githubusercontent.com/u/864772?v=3","gravatar_id":"","url":"https://api.github.com/users/vortec","html_url":"https://github.com/vortec","followers_url":"https://api.github.com/users/vortec/followers","following_url":"https://api.github.com/users/vortec/following{/other_user}","gists_url":"https://api.github.com/users/vortec/gists{/gist_id}","starred_url":"https://api.github.com/users/vortec/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/vortec/subscriptions","organizations_url":"https://api.github.com/users/vortec/orgs","repos_url":"https://api.github.com/users/vortec/repos","events_url":"https://api.github.com/users/vortec/events{/privacy}","received_events_url":"https://api.github.com/users/vortec/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":3,"created_at":"2016-04-11T13:02:28Z","updated_at":"2016-04-11T13:42:14Z","closed_at":null,"body":"Hi, I was trying to rebuild the image, but getting the following error:\r\n\r\n    g++ -pthread -rdynamic -m64  -o /node-v5.10.1/out/Release/openssl-cli -Wl,--start-group /node-v5.10.1/out/Release/obj.target/openssl-cli/deps/openssl/openssl/apps/app_rand.o /node-v5.10.1/out/Release/obj.target/openssl-cli/deps/openssl/openssl/apps/apps.o /node-v5.10.1/out/Release/obj.target/openssl-cli/deps/openssl/openssl/apps/asn1pars.o /node-v5.10.1/out/Release/obj.target/openssl-cli/deps/openssl/openssl/apps/ca.o /node-v5.10.1/out/Release/obj.target/openssl-cli/deps/openssl/openssl/apps/ciphers.o /node-v5.10.1/out/Release/obj.target/openssl-cli/deps/openssl/openssl/apps/cms.o /node-v5.10.1/out/Release/obj.target/openssl-cli/deps/openssl/openssl/apps/crl.o /node-v5.10.1/out/Release/obj.target/openssl-cli/deps/openssl/openssl/apps/crl2p7.o /node-v5.10.1/out/Release/obj.target/openssl-cli/deps/openssl/openssl/apps/dgst.o /node-v5.10.1/out/Release/obj.target/openssl-cli/deps/openssl/openssl/apps/dh.o /node-v5.10.1/out/Release/obj.target/openssl-cli/deps/openssl/openssl/apps/dhparam.o /node-v5.10.1/out/Release/obj.target/openssl-cli/deps/openssl/openssl/apps/dsa.o /node-v5.10.1/out/Release/obj.target/openssl-cli/deps/openssl/openssl/apps/dsaparam.o /node-v5.10.1/out/Release/obj.target/openssl-cli/deps/openssl/openssl/apps/ec.o /node-v5.10.1/out/Release/obj.target/openssl-cli/deps/openssl/openssl/apps/ecparam.o /node-v5.10.1/out/Release/obj.target/openssl-cli/deps/openssl/openssl/apps/enc.o /node-v5.10.1/out/Release/obj.target/openssl-cli/deps/openssl/openssl/apps/engine.o /node-v5.10.1/out/Release/obj.target/openssl-cli/deps/openssl/openssl/apps/errstr.o /node-v5.10.1/out/Release/obj.target/openssl-cli/deps/openssl/openssl/apps/gendh.o /node-v5.10.1/out/Release/obj.target/openssl-cli/deps/openssl/openssl/apps/gendsa.o /node-v5.10.1/out/Release/obj.target/openssl-cli/deps/openssl/openssl/apps/genpkey.o /node-v5.10.1/out/Release/obj.target/openssl-cli/deps/openssl/openssl/apps/genrsa.o /node-v5.10.1/out/Release/obj.target/openssl-cli/deps/openssl/openssl/apps/nseq.o /node-v5.10.1/out/Release/obj.target/openssl-cli/deps/openssl/openssl/apps/ocsp.o /node-v5.10.1/out/Release/obj.target/openssl-cli/deps/openssl/openssl/apps/openssl.o /node-v5.10.1/out/Release/obj.target/openssl-cli/deps/openssl/openssl/apps/passwd.o /node-v5.10.1/out/Release/obj.target/openssl-cli/deps/openssl/openssl/apps/pkcs12.o /node-v5.10.1/out/Release/obj.target/openssl-cli/deps/openssl/openssl/apps/pkcs7.o /node-v5.10.1/out/Release/obj.target/openssl-cli/deps/openssl/openssl/apps/pkcs8.o /node-v5.10.1/out/Release/obj.target/openssl-cli/deps/openssl/openssl/apps/pkey.o /node-v5.10.1/out/Release/obj.target/openssl-cli/deps/openssl/openssl/apps/pkeyparam.o /node-v5.10.1/out/Release/obj.target/openssl-cli/deps/openssl/openssl/apps/pkeyutl.o /node-v5.10.1/out/Release/obj.target/openssl-cli/deps/openssl/openssl/apps/prime.o /node-v5.10.1/out/Release/obj.target/openssl-cli/deps/openssl/openssl/apps/rand.o /node-v5.10.1/out/Release/obj.target/openssl-cli/deps/openssl/openssl/apps/req.o /node-v5.10.1/out/Release/obj.target/openssl-cli/deps/openssl/openssl/apps/rsa.o /node-v5.10.1/out/Release/obj.target/openssl-cli/deps/openssl/openssl/apps/rsautl.o /node-v5.10.1/out/Release/obj.target/openssl-cli/deps/openssl/openssl/apps/s_cb.o /node-v5.10.1/out/Release/obj.target/openssl-cli/deps/openssl/openssl/apps/s_client.o /node-v5.10.1/out/Release/obj.target/openssl-cli/deps/openssl/openssl/apps/s_server.o /node-v5.10.1/out/Release/obj.target/openssl-cli/deps/openssl/openssl/apps/s_socket.o /node-v5.10.1/out/Release/obj.target/openssl-cli/deps/openssl/openssl/apps/s_time.o /node-v5.10.1/out/Release/obj.target/openssl-cli/deps/openssl/openssl/apps/sess_id.o /node-v5.10.1/out/Release/obj.target/openssl-cli/deps/openssl/openssl/apps/smime.o /node-v5.10.1/out/Release/obj.target/openssl-cli/deps/openssl/openssl/apps/speed.o /node-v5.10.1/out/Release/obj.target/openssl-cli/deps/openssl/openssl/apps/spkac.o /node-v5.10.1/out/Release/obj.target/openssl-cli/deps/openssl/openssl/apps/srp.o /node-v5.10.1/out/Release/obj.target/openssl-cli/deps/openssl/openssl/apps/ts.o /node-v5.10.1/out/Release/obj.target/openssl-cli/deps/openssl/openssl/apps/verify.o /node-v5.10.1/out/Release/obj.target/openssl-cli/deps/openssl/openssl/apps/version.o /node-v5.10.1/out/Release/obj.target/openssl-cli/deps/openssl/openssl/apps/x509.o /node-v5.10.1/out/Release/obj.target/deps/openssl/libopenssl.a -Wl,--end-group -static -ldl\r\n    g++ -pthread -rdynamic -m64 -fuse-ld=gold -B/node-v5.10.1/third_party/binutils/Linux_x64/Release/bin -m64  -o /node-v5.10.1/out/Release/mksnapshot -Wl,--start-group /node-v5.10.1/out/Release/obj.target/mksnapshot/deps/v8/src/snapshot/mksnapshot.o /node-v5.10.1/out/Release/obj.target/deps/v8/tools/gyp/libv8_base.a /node-v5.10.1/out/Release/obj.target/deps/v8/tools/gyp/libv8_nosnapshot.a /node-v5.10.1/out/Release/obj.target/deps/v8/tools/gyp/libv8_libplatform.a /node-v5.10.1/out/Release/obj.target/deps/v8/tools/gyp/libv8_libbase.a -Wl,--end-group -static -ldl -lrt\r\n\r\n    /usr/lib/gcc/x86_64-alpine-linux-musl/5.3.0/../../../../x86_64-alpine-linux-musl/bin/ld.gold: fatal error: /node-v5.10.1/out/Release/mksnapshot: Not supported\r\n    collect2: error: ld returned 1 exit status\r\n    make[1]: *** [/node-v5.10.1/out/Release/mksnapshot] Error 1\r\n    deps/v8/tools/gyp/mksnapshot.target.mk:140: recipe for target '/node-v5.10.1/out/Release/mksnapshot' failed\r\n    make[1]: Leaving directory '/node-v5.10.1/out'\r\n    make: *** [node] Error 2\r\n    Makefile:63: recipe for target 'node' failed\r\n\r\n    The command '/bin/sh -c apk add --no-cache curl make gcc g++ binutils-gold python linux-headers paxctl libgcc libstdc++ gnupg &&   gpg --keyserver pool.sks-keyservers.net --recv-keys 9554F04D7259F04124DE6B476D5A82AC7E37093B &&   gpg --keyserver pool.sks-keyservers.net --recv-keys 94AE36675C464D64BAFA68DD7434390BDBE9B9C5 &&   gpg --keyserver pool.sks-keyservers.net --recv-keys 0034A06D9D9B0064CE8ADF6BF1747F4AD2306D93 &&   gpg --keyserver pool.sks-keyservers.net --recv-keys FD3A5288F042B6850C66B31F09FE44734EB7990E &&   gpg --keyserver pool.sks-keyservers.net --recv-keys 71DCFD284A79C3B38668286BC97EC7A07EDE3FC1 &&   gpg --keyserver pool.sks-keyservers.net --recv-keys DD8F2338BAE7501E3DD5AC78C273792F7D83545D &&   gpg --keyserver pool.sks-keyservers.net --recv-keys C4F0DFFF4E8C1A8236409D08E73BC641CC11F4C8 &&   gpg --keyserver pool.sks-keyservers.net --recv-keys B9AE9905FFD7803F25714661B63B535A4C206CA9 &&   curl -o node-${VERSION}.tar.gz -sSL https://nodejs.org/dist/${VERSION}/node-${VERSION}.tar.gz &&   curl -o SHASUMS256.txt.asc -sSL https://nodejs.org/dist/${VERSION}/SHASUMS256.txt.asc &&   gpg --verify SHASUMS256.txt.asc &&   grep node-${VERSION}.tar.gz SHASUMS256.txt.asc | sha256sum -c - &&   tar -zxf node-${VERSION}.tar.gz &&   cd /node-${VERSION} &&   ./configure --prefix=/usr ${CONFIG_FLAGS} &&   make -j$(grep -c ^processor /proc/cpuinfo 2>/dev/null || 1) &&   make install &&   paxctl -cm /usr/bin/node &&   cd / &&   if [ -x /usr/bin/npm ]; then     npm install -g npm@${NPM_VERSION} &&     find /usr/lib/node_modules/npm -name test -o -name .bin -type d | xargs rm -rf;   fi &&   apk del curl make gcc g++ binutils-gold python linux-headers paxctl gnupg ${DEL_PKGS} &&   rm -rf /etc/ssl /node-${VERSION}.tar.gz /SHASUMS256.txt.asc /node-${VERSION} ${RM_DIRS}     /usr/share/man /tmp/* /var/cache/apk/* /root/.npm /root/.node-gyp /root/.gnupg     /usr/lib/node_modules/npm/man /usr/lib/node_modules/npm/doc /usr/lib/node_modules/npm/html' returned a non-zero code: 2`"},"comment":{"url":"https://api.github.com/repos/mhart/alpine-node/issues/comments/208350452","html_url":"https://github.com/mhart/alpine-node/issues/31#issuecomment-208350452","issue_url":"https://api.github.com/repos/mhart/alpine-node/issues/31","id":208350452,"user":{"login":"mhart","id":367936,"avatar_url":"https://avatars.githubusercontent.com/u/367936?v=3","gravatar_id":"","url":"https://api.github.com/users/mhart","html_url":"https://github.com/mhart","followers_url":"https://api.github.com/users/mhart/followers","following_url":"https://api.github.com/users/mhart/following{/other_user}","gists_url":"https://api.github.com/users/mhart/gists{/gist_id}","starred_url":"https://api.github.com/users/mhart/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mhart/subscriptions","organizations_url":"https://api.github.com/users/mhart/orgs","repos_url":"https://api.github.com/users/mhart/repos","events_url":"https://api.github.com/users/mhart/events{/privacy}","received_events_url":"https://api.github.com/users/mhart/received_events","type":"User","site_admin":false},"created_at":"2016-04-11T13:42:14Z","updated_at":"2016-04-11T13:42:14Z","body":"Apparently that issue can occur when using a Grsecurity/PaX kernel – which I never have, so I haven't run into it.\r\n\r\nTry adding a couple of steps before the `make` step:\r\n```\r\n...\r\nmake -j$(grep -c ^processor /proc/cpuinfo 2>/dev/null || 1) -C out mksnapshot BUILDTYPE=Release && \\\r\npaxctl -cm out/Release/mksnapshot && \\\r\nmake -j$(grep -c ^processor /proc/cpuinfo 2>/dev/null || 1) && \\\r\nmake install && \\\r\n...\r\n```"}}