From 01194dda5c8732140d336dad505fff63085e88a4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ciro=20Santilli=20=E5=85=AD=E5=9B=9B=E4=BA=8B=E4=BB=B6=20?= =?UTF-8?q?=E6=B3=95=E8=BD=AE=E5=8A=9F?= Date: Fri, 15 Feb 2019 00:00:00 +0000 Subject: [PATCH] userland: --static implies --userland-build-id static --- README.adoc | 13 +++++-------- build-userland | 8 -------- common.py | 13 ++++++++++++- 3 files changed, 17 insertions(+), 17 deletions(-) diff --git a/README.adoc b/README.adoc index fe758a4..2b99142 100644 --- a/README.adoc +++ b/README.adoc @@ -3081,11 +3081,10 @@ You can also try statically linked executables with: ./build-userland \ --arch aarch64 \ --static \ - --userland-build-id static \ ; ./run \ --arch aarch64 \ - --userland-build-id static \ + --static \ --userland print_argv \ --userland-args 'asdf "qw er"' \ ; @@ -3098,11 +3097,10 @@ Or you can run statically linked built by the host packaged toolchain with: --arch aarch64 \ --host \ --static \ - --userland-build-id host-static \ ; ./run \ --arch aarch64 \ - --userland-build-id host-static \ + --static \ --userland print_argv \ --userland-args 'asdf "qw er"' \ ; @@ -3173,7 +3171,6 @@ So let's just play with some static ones: ./build-userland \ --arch aarch64 \ --static \ - --userland-build-id static \ ; ./run \ --arch aarch64 \ @@ -3191,16 +3188,16 @@ Step debug also works: ./run \ --arch aarch64 \ --emulator gem5 \ + --static \ --userland print_argv \ --userland-args 'asdf "qw er"' \ - --userland-build-id static \ --wait-gdb \ ; ./run-gdb \ --arch aarch64 \ --emulator gem5 \ + --static \ --userland print_argv \ - --userland-build-id static \ main \ ; .... @@ -3210,7 +3207,7 @@ Step debug also works: As of gem5 7fa4c946386e7207ad5859e8ade0bbfc14000d91, the crappy `se.py` script does not forward the exit status of syscall emulation mode, you can test it with: .... -./run --dry-run --emulator gem5 --userland false --userland-build-id static +./run --dry-run --emulator gem5 --static --userland false .... Source: link:userland/false[]. diff --git a/build-userland b/build-userland index 37a1dfa..5ff5d96 100755 --- a/build-userland +++ b/build-userland @@ -34,14 +34,6 @@ Use the host packaged cross toolchain. '--make-args', default='', ) - self.add_argument( - '--static', - default=False, - help='''\ -Build the executables statically. TODO not implemented: Set the build id to 'static' -if one was not given explicitly. -''', - ) self.add_argument( 'targets', default=[], diff --git a/common.py b/common.py index 71e4f76..0558359 100644 --- a/common.py +++ b/common.py @@ -347,6 +347,14 @@ Machine type: ) # Userland. + self.add_argument( + '--static', + default=False, + help='''\ +Build userland executables statically. Set --userland-build-id to 'static' +if one was not given explicitly. +''', + ) self.add_argument( '-u', '--userland', help='''\ @@ -441,7 +449,10 @@ Valid emulators: {} if env['emulator'] in env['emulator_short_to_long_dict']: env['emulator'] = env['emulator_short_to_long_dict'][env['emulator']] if not env['_args_given']['userland_build_id']: - env['userland_build_id'] = env['default_build_id'] + if env['static']: + env['userland_build_id'] = 'static' + else: + env['userland_build_id'] = env['default_build_id'] if not env['_args_given']['gem5_build_id']: if env['_args_given']['gem5_worktree']: env['gem5_build_id'] = env['gem5_worktree']