Facing issue with - `configure: error: no such option: --enable-lto`
twitu opened this issue · 2 comments
twitu commented
I'm building an image using this command docker build --build-arg version=8.0.0 --build-arg arch=x86_64 .
. However I'm getting this error
Usage: configure [options]
configure: error: no such option: --enable-lto
on step 13 which is this piece here.
RUN tar -xf "node-v$NODE_VERSION.tar.xz" \
&& cd "node-v$NODE_VERSION" \
&& /patch.sh ${BUILD_ARCH} ${NODE_VERSION} \
&& export TARGET=$(/build.sh target ${BUILD_ARCH:-""}) \
&& export CC=$TARGET-gcc \
&& export CXX=$TARGET-g++ \
&& export AR=$TARGET-ar \
&& export LINK=$TARGET-g++ \
&& export CXXFLAGS="-O3 -ffunction-sections -fdata-sections" \
&& export LDFLAGS="-Wl,--gc-sections,--strip-all $(/build.sh ld_flags ${BUILD_ARCH:-""})" \
&& ln -snf libc.so /usr/local/$TARGET/lib/ld-musl-*.so.1 \
&& ln -snf /usr/local/$TARGET/lib/ld-musl-*.so.1 /lib \
&& ./configure \
--partly-static \
--with-intl=small-icu \
--without-dtrace \
--without-inspector \
--without-etw \
$(/build.sh node_config ${BUILD_ARCH:-""}) \
&& make -j$(getconf _NPROCESSORS_ONLN) V=
I'm not sure what is causing the error or how to resolve it. Please let me know if you need more information.
astefanutti commented
I suspect LTO is not supported as configuration option to build NodeJS version 8.0.0.
You can either try to build a more recent version of NodeJS, or remove the option:
Line 73 in 5ab6d86
Ideally, the build script should check the NodeJS version.
twitu commented
Yes removing these lines for node version 8 makes it works thanks for the help.