-
Notifications
You must be signed in to change notification settings - Fork 29.6k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
build: mkpeephole fails during cross compiling #9707
Comments
I should note that node v4.x compiles without such build issues (not including manual patches needed for V8 and other sources), using the same configure flags (minus the newer flags of course). |
it is a v8 issue; |
I'll leave this issue open but unfortunately I've bricked the device I was testing with (with no easy way to un-brick it), so I won't be able to test any fixes... |
@bnoordhuis please consider also this simple bash script 👍 https://gist.github.com/artynet/bc7b12e91c81dd4d4bed7cf9d47c9a02 to build a cross-compiled binary release of the node sources for Raspberry Pi 2. It relies on a pre-existing native build so to leverage the native mkpeephole tool which of course being cross-compiled during the normal build can't be executed by the host machine. This binary build should be residing in the very same folder of the new source to cross-compile. The cross-toolchain has been generated with the crosstools-ng suite. Best, Arturo |
@artynet If you have a script that builds from inside a source tree instead of downloading a tarball, you're welcome to open a pull request. Try to unify it with the android-configure script if possible. |
@mscdex please take a look at my new openwrt makefile quoted a couple of posts ago.... |
@artynet As I mentioned previously, I can't test any changes because the device I was testing with is bricked, so I'm not the best person to ask to review/test any changes. |
This is the quickest fix I come up with : --- a/android-configure 2016-12-20 20:53:59.000000000 +0100
+++ b/android-configure 2016-12-22 23:25:34.535540854 +0100
@@ -8,6 +8,12 @@
# modules with npm. Also, don't forget to set the arch in npm config using
# 'npm config set arch=<arch>'
+if [ -z $3 ]; then
+ echo "insert node version !"
+ return 1
+fi
+
+VERSION=$3
if [ -z "$2" ]; then
ARCH=arm
@@ -15,6 +21,14 @@
ARCH="$2"
fi
+fixv7 () {
+
+ var=$(readlink -f ../node-v$VERSION-linux)"/out/Release/mkpeephole"
+ echo $var
+ sed "s#<(mkpeephole_exec)#$var#g" -i deps/v8/src/v8.gyp
+
+}
+
CC_VER="4.9"
case $ARCH in
arm)
@@ -38,13 +52,16 @@
;;
esac
+# fixing mkpeephole system call
+fixv7 $3
+
export TOOLCHAIN=$PWD/android-toolchain
mkdir -p $TOOLCHAIN
$1/build/tools/make-standalone-toolchain.sh \
--toolchain=$TOOLCHAIN_NAME-$CC_VER \
--arch=$ARCH \
--install-dir=$TOOLCHAIN \
- --platform=android-21
+ --platform=android-21 --force
export PATH=$TOOLCHAIN/bin:$PATH
export AR=$TOOLCHAIN/bin/$SUFFIX-ar
export CC=$TOOLCHAIN/bin/$SUFFIX-gcc
@@ -62,5 +79,6 @@
--dest-cpu=$DEST_CPU \
--dest-os=android \
--without-snapshot \
- --openssl-no-asm
+ --openssl-no-asm \
+ --without-intl
fi
for node7 v7.3.0 (latest release). We have to find a way to make it universal for the trunk tree. As mentioned before, a native build for the host machine is needed as a prerequisite. Best, Arturo |
I'm trying to build node for mips on centos with a different error:
Is this related? |
Seems to me that yes, they are related... It probably means that your
CentOS can execute the mips-compiled mkpeephole binary.
El 01/07/2017 00:58, "Homa Wong" <notifications@github.com> escribió:
… I'm trying to build node for mips on centos with a different error:
node-8.1.3/out/Release/mkpeephole: cannot execute binary file
Is this related?
—
You are receiving this because you are subscribed to this thread.
Reply to this email directly, view it on GitHub
<#9707 (comment)>, or mute
the thread
<https://github.com/notifications/unsubscribe-auth/AAgfvvAlhLX1-CCQEElURSNAhwTBIWR4ks5sJX2LgaJpZM4K3dUN>
.
|
Seems this patch from @nxhack fix it, can some of the maintainers point out if it's in the correct way? |
I'm not sure, but now you've make me doubt... Maybe @nxhack should do some pull-requests for them? |
It seems that patch related to 'mkpeephole' becomes unnecessary in node.js 8.3.0 and later releases. |
What do you mean? Does it works now? I'm still getting build fails... |
|
It's still fetching incorectly the host cpu from the toolchain, but efectively, I can confirm that now cross-compiling works again. |
|
I'm trying to cross-compile node v7.x for a MIPS device running OpenWrt. At first I ran into an issue where mkpeephole was failing because it was trying to do something on the host system for the target but it was using the target compiler (CC and CXX env vars set).
So then I tried setting
CC_host=gcc
andCXX_host=g++
and now I get this:because it's trying to use the host compiler to compile that accounting-allocator.cc, even though it used the target compiler to build other V8 source files before this error.
With CC_host/CXX_host set and these configure flags: --without-snapshot --without-intl --without-inspector --without-ssl --dest-os=linux --dest-cpu=mips
I get this config.gypi:
The text was updated successfully, but these errors were encountered: