external_deps: rebuild nacl_loader for Linux amd64#1638
external_deps: rebuild nacl_loader for Linux amd64#1638slipher merged 1 commit intoDaemonEngine:masterfrom
Conversation
|
One more thing I would like to do is see if I can run the tests. (Manually, not in the script.) Unvanquished seems to work, but there are native client tests that verify e.g. stuff about how the binary is linked, which could be important for security properties. I might attempt to run the tests by copying the built binaries into an un-hacked version of native_client that still uses Chromium tools. |
|
Not your fault, but this is annoying: |
|
Actually I'm very happy that you investigate rebuilding the loader! |
What version of LLVM do you have? Can you try running |
My default clang is
|
53a5277 to
a50a1e4
Compare
external_deps/build.sh
Outdated
| "${download_only}" && return | ||
|
|
||
| cd "${dir_name}" | ||
| scons "platform=${NACL_ARCH}" MODE=opt-host werror=0 naclsdk_validate=0 sysinfo=0 sel_ldr |
There was a problem hiding this comment.
You can do: MODE=opt-linux to be explicit.
Anyway it is not possible to cross-compile with the current Scons build.
There was a problem hiding this comment.
Done.
Anyway it is not possible to cross-compile with the current Scons build.
Maybe if I hadn't commented out the sysroot part hehe
There was a problem hiding this comment.
A lot of code like that just detects the target by scanning the host (even GetOS() relies on Python's sys.platform…):
# Some of our tools utilize a unique platform string which is used to
# distinguish between platform and architectures.
def PlatformTriple(platform=None, machine=None):
os = GetOS(platform)
arch3264 = GetArch3264(machine)
if os == OS_WIN:
if IsCygWin(platform):
return 'i686-pc-cygwin'
else:
return 'i686-w64-mingw32'
elif os == OS_MAC:
return 'x86_64-apple-darwin'
elif os == OS_LINUX:
if arch3264 == ARCH3264_ARM:
# TODO(mcgrathr): How to distinguish gnueabi vs gnueabihf?
return 'arm-linux-gnueabihf'
elif arch3264 == ARCH3264_X86_32:
return 'i686-linux'
elif arch3264 == ARCH3264_X86_64:
return 'x86_64-linux'
raise Exception('Unknown platform and machine')There was a problem hiding this comment.
I tried with upstream native_client and it manages to build something for ARM if I do sudo apt install gcc-arm-linux-gnueabihf and ./scons --verbose platform=arm MODE=opt-linux naclsdk_validate=0 sysinfo=0 -j1 sel_ldr. (Yes, it now uses GCC instead of Clang...)
There was a problem hiding this comment.
Weird, I get many other errors when I try that…
There was a problem hiding this comment.
FYI, here is the error I get when attempting to cross-compile an arm loader:
$ scons platform=arm MODE=opt-linux naclsdk_validate=0 werror=0 sysinfo=0 sel_ldr
scons: Reading SConscript files ...
======================================================================
Warning: "--mode" did not specify both trusted and untrusted build environments. As a result, many tests will not be run.
======================================================================
*** SKIPPING opt-linux-32 : run_nacl_desc_io_alloc_ctor_test
AttributeError: 'SConsEnvironment' object has no attribute 'Program':
File "native_client/SConstruct", line 3887:
BuildEnvironments(selected_envs)
File "site_init", line 203:
File "/usr/lib/python3/dist-packages/SCons/Util/envs.py", line 242:
return self.method(*nargs, **kwargs)
File "native_client/site_scons/site_tools/defer.py", line 148:
func(env)
File "site_init", line 125:
File "/usr/lib/python3/dist-packages/SCons/Script/SConscript.py", line 598:
return _SConscript(self.fs, *files, **subst_kw)
File "/usr/lib/python3/dist-packages/SCons/Script/SConscript.py", line 285:
exec(compile(scriptdata, scriptname, 'exec'), call_stack[-1].globals)
File "native_client/src/trusted/validator_arm/build.scons", line 271:
nexe = untrusted_env.ComponentProgram(test, 'testdata/' + test + '.S',
File "/usr/lib/python3/dist-packages/SCons/Util/envs.py", line 242:
return self.method(*nargs, **kwargs)
File "native_client/site_scons/site_tools/component_builders.py", line 485:
out_nodes = env.Program(prog_name, *args, **kwargs)
a4f70d0 to
4d9cc75
Compare
|
What is the reason for not having cloned the full |
Right, mentionned in README:
|
4d9cc75 to
bfb4be2
Compare
Add the naclruntime target to external_deps/build.sh. It builds nacl_loader and nacl_helper_bootstrap. This uses our version of the native_client repository with a hacked build script that lets us build native binaries without Chromium tools. The build brings two dependencies: LLVM and SCons. Fixes DaemonEngine#1504 (NaCl crash handling doesn't work with recent Linux kernels.)
bfb4be2 to
0353e12
Compare
Add the
naclruntimetarget toexternal_deps/build.sh. It buildsnacl_loaderandnacl_helper_bootstrap.This uses our version of the native_client repository, with a hacked build script that lets us build native binaries without Chromium tools. The build brings two dependencies: LLVM and SCons. Though we already needed LLVM for the MSVC platforms, for the silly reason of generating
.libs.Fixes #1504 (NaCl crash handling doesn't work with recent Linux kernels.)
TODO:
nacl_loaderfrom the Linux amd64naclsdktarget so they don't step on each other.naclruntimeto the package lists.