-
Notifications
You must be signed in to change notification settings - Fork 284
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
how the official linux binary is built? #1039
Comments
Nothing special, there's no secret sauce. Look for the We do compile it on the oldest supported system for forward compatibility. So if you want to target Fedora 6 (is that a typo?) and 27, compile on the older system and copy the binary to the newer system, not the other way around.
That's because glibc is written that way, it's not specific to node.js. You probably want |
Many thanks for the quick reply! I will definitely look into the $(BINARYTAR) target in Makefile. Yes, I know it sounds "wrong" :-) but that's not a typo - I do have a Fedora 6 target. The reason I tried to build on Fedora 27 instead of 6 is because I couldn't get it to compile on Fedora 6. I think one of the reasons is gcc version is too old on Fedora 6 to compile node. Can you please let me know what is the "oldest supported system". I think I should install the same thing and do my build there. That way, I can be sure it will work on my Fedora 6 target. Thanks again for your help! |
For Fedora, it's what Fedora supports - not FC6. :-) I suspect you're going to have trouble with libstdc++ being too old. As a workaround, you could try |
Oh, another thing: if your kernel is < 2.6.18, you're out of luck (but FC6 was 2.6.20, IIRC?) |
@joyeecheung @bnoordhuis - many thanks for your help. I will give it a try to see if I can build binary that will work with FC6 (2.6.22.14-72.fc6). Will report back here. |
Sorry for the long delay to report back my progress. Was off to some other projects and now coming back to this since past week. I am still not able to build a node binary that will work with FC6, even I tried build the whole thing on an FC6. Here is my "struggling" (all done on a freshly installed FC6 VM with development RPM packages):
At this point, I don't know how to move forward, as I am not sure why mksnapshot was built (I assume it was built during building node binary build) with reference to a newer libstdc++ but when it is executed trying to load older libstdc++.
|
Devtoolset for CentOS is part of Software Collections (https://www.softwarecollections.org/en/), specifically at https://www.softwarecollections.org/en/scls/?search=devtoolset for the various available versions. I'm using CentOS as the build environment rather than RHEL, so I'm followed the instructions to get the Devtoolset from there. I'm not sure how this relates to the Devtoolset available from RedHat (https://developers.redhat.com/products/developertoolset/overview/), which requires a RedHat Enterprise subscription, but it appears to offer the same features. The instructions on Software Collections describe how to deploy on both CentOS and RHEL. However, I don't know whether it's going to work on Fedora Core 6. |
@shyhpei why are you using Fedora Core 6? Software Collections and Devtoolset are not built for Fedora, only for RHEL and CentOS. You could try building node on CentOS 6 and then running it on your FC6 host, but I am not sure it will work. |
@dtopham75 - thanks for pointing that out. Will definitely take a look of the Software Collections and see if I can generate a binary for earlier version of CentOS will work for FC6. @kasicka - we have an embedded system which is running on FC6 and we need node, with FIPS (that's why we need to build it instead of just using official binary) |
@shyhpei - is this still outstanding? |
@gireeshpunathil - sorry I should close this. No, I am still not able to make a shared-library binary for FC6 on any build environment that has gcc version at or above 4.8.x (requirement). I can only build with --fully-static then it'll run on FC6. And that's what I currently am using but I am not sure about the stability on that build as glibc won't be "fully-static" as @bnoordhuis pointed out earlier. Also, I was having problem install Software Collections on CentOS as it refused to install for some dependency problem. I gave up on that also. |
sorry to hear that your problem is not fully resolved. Do you believe any additional information / workarounds / configuration from Node build setup will help resolve your issues, if so we can re-open it and progress, but if the problem is deeply rooted in the underlying system / incompatible build toolchain / runtime systems etc. I guess there is nothing we can do about that! Let me know what do you think. |
@shyhpei Please file a bug, but devtoolset should be functional |
Appreciate all the helps I got here. But I think I am fine with my current fully-static on glibc build unless it crashes on me later on. :-) The only thing that I don't understand is how the official nodejs build machine, I assume it's using a gcc version > 4.8.x, can make a shared glibc nodejs binary that can run on FC6 without any problem. The glibc on FC6 is completely incompatible with the glibc for 4.8.x... |
Version: 6.11.5
Platform: Linux fcdev 4.13.13-300.fc27.x86_64 #1 SMP Wed Nov 15 15:47:50 UTC 2017 x86_64 x86_64 x86_64 GNU/Linux
I am trying to build nodejs binary on a Fedora 27 host, using --fully-static, because my target host is Fedora Core 6. This is how I build:
./configure --fully-static
make -j
The compile/link would go thru and generate a node binary, with some warnings similar to the one below:
dso_dlfcn.c:(.text+0x12): warning: Using 'dlopen' in statically linked applications requires at runtime the shared libraries from the glibc version used for linking
/home/syen/src/node-v6.11.5/out/Release/obj.target/node/src/node.o: In function `node::InitGroups(v8::FunctionCallbackInfov8::Value const&)':
But I could run this node binary just fine on the Fedora 27 build host. But when I copy node binary to my target Fedora 6 host and run it, it would segment fault immediately without even get to the ">" prompt.
The weird thing is, the official linux binary from nodejs.org site would have no problem running on my target Fedora 6 host. I can get a ">" prompt, and I can execute my javascript with this binary.
So, my questions:
I've looked up and down on nodejs website and I couldn't find any documentation on how the official binary was built...
The text was updated successfully, but these errors were encountered: