mirror of
https://github.com/systemd/systemd.git
synced 2024-12-31 21:18:09 +03:00
Merge pull request #33599 from keszybz/link-executor-statically
Link executor statically
This commit is contained in:
commit
c80c5c20d4
@ -2089,7 +2089,7 @@ libsystemd = shared_library(
|
||||
# Make sure our library is never deleted from memory, so that our open logging fds don't leak on dlopen/dlclose cycles.
|
||||
'-z', 'nodelete',
|
||||
'-Wl,--version-script=' + libsystemd_sym_path],
|
||||
link_with : [libbasic],
|
||||
link_with : [libbasic_static],
|
||||
link_whole : [libsystemd_static],
|
||||
dependencies : [librt,
|
||||
threads,
|
||||
@ -2255,7 +2255,7 @@ nss_template = {
|
||||
'link_with' : [
|
||||
libsystemd_static,
|
||||
libshared_static,
|
||||
libbasic,
|
||||
libbasic_static,
|
||||
],
|
||||
'dependencies' : [
|
||||
librt,
|
||||
|
@ -21,6 +21,8 @@ option('rootprefix', type : 'string', deprecated: true,
|
||||
description : 'This option is deprecated and will be removed in a future release')
|
||||
option('link-udev-shared', type : 'boolean',
|
||||
description : 'link systemd-udevd and its helpers to libsystemd-shared.so')
|
||||
option('link-executor-shared', type : 'boolean',
|
||||
description : 'link systemd-executor to libsystemd-shared.so and libsystemd-core.so')
|
||||
option('link-systemctl-shared', type: 'boolean',
|
||||
description : 'link systemctl against libsystemd-shared.so')
|
||||
option('link-networkd-shared', type: 'boolean',
|
||||
|
@ -274,7 +274,7 @@ filesystem_switch_case_h = custom_target(
|
||||
|
||||
basic_sources += [filesystem_list_h, filesystem_switch_case_h, filesystems_gperf_h]
|
||||
|
||||
libbasic = static_library(
|
||||
libbasic_static = static_library(
|
||||
'basic',
|
||||
basic_sources,
|
||||
fundamental_sources,
|
||||
|
@ -110,17 +110,13 @@ load_fragment_gperf_nulstr_c = custom_target(
|
||||
|
||||
libcore_name = 'systemd-core-@0@'.format(shared_lib_tag)
|
||||
|
||||
libcore = shared_library(
|
||||
libcore_static = static_library(
|
||||
libcore_name,
|
||||
libcore_sources,
|
||||
load_fragment_gperf_c,
|
||||
load_fragment_gperf_nulstr_c,
|
||||
include_directories : includes,
|
||||
c_args : ['-fvisibility=default'],
|
||||
link_args : ['-shared',
|
||||
'-Wl,--version-script=' + libshared_sym_path],
|
||||
link_depends : libshared_sym_path,
|
||||
link_with : libshared,
|
||||
dependencies : [libacl,
|
||||
libapparmor,
|
||||
libaudit,
|
||||
@ -135,6 +131,16 @@ libcore = shared_library(
|
||||
libselinux,
|
||||
threads,
|
||||
userspace],
|
||||
build_by_default : false)
|
||||
|
||||
libcore = shared_library(
|
||||
libcore_name,
|
||||
c_args : ['-fvisibility=default'],
|
||||
link_args : ['-shared',
|
||||
'-Wl,--version-script=' + libshared_sym_path],
|
||||
link_depends : libshared_sym_path,
|
||||
link_whole: libcore_static,
|
||||
link_with : libshared,
|
||||
install : true,
|
||||
install_dir : pkglibdir)
|
||||
|
||||
@ -151,6 +157,17 @@ systemd_executor_sources = files(
|
||||
'exec-invoke.c',
|
||||
)
|
||||
|
||||
executor_libs = get_option('link-executor-shared') ? \
|
||||
[
|
||||
libcore,
|
||||
libshared,
|
||||
] : [
|
||||
libcore_static,
|
||||
libshared_static,
|
||||
libbasic_static,
|
||||
libsystemd_static,
|
||||
]
|
||||
|
||||
executables += [
|
||||
libexec_template + {
|
||||
'name' : 'systemd',
|
||||
@ -168,10 +185,7 @@ executables += [
|
||||
'public' : true,
|
||||
'sources' : systemd_executor_sources,
|
||||
'include_directories' : core_includes,
|
||||
'link_with' : [
|
||||
libcore,
|
||||
libshared,
|
||||
],
|
||||
'link_with' : executor_libs,
|
||||
'dependencies' : [
|
||||
libapparmor,
|
||||
libpam,
|
||||
|
@ -125,7 +125,7 @@ libsystemd_static = static_library(
|
||||
libsystemd_sources,
|
||||
include_directories : libsystemd_includes,
|
||||
c_args : libsystemd_c_args,
|
||||
link_with : [libbasic],
|
||||
link_with : [libbasic_static],
|
||||
dependencies : [threads,
|
||||
libm,
|
||||
librt,
|
||||
|
@ -32,7 +32,7 @@ executables += [
|
||||
'sources' : files('repart.c'),
|
||||
'c_args' : '-DSTANDALONE',
|
||||
'link_with' : [
|
||||
libbasic,
|
||||
libbasic_static,
|
||||
libshared_fdisk,
|
||||
libshared_static,
|
||||
libsystemd_static,
|
||||
|
@ -357,7 +357,7 @@ libshared = shared_library(
|
||||
'-Wl,--version-script=' + libshared_sym_path],
|
||||
link_depends : libshared_sym_path,
|
||||
link_whole : [libshared_static,
|
||||
libbasic,
|
||||
libbasic_static,
|
||||
libsystemd_static],
|
||||
dependencies : [libshared_deps,
|
||||
userspace],
|
||||
|
@ -20,7 +20,7 @@ executables += [
|
||||
'sources' : systemd_shutdown_sources,
|
||||
'c_args' : '-DSTANDALONE',
|
||||
'link_with' : [
|
||||
libbasic,
|
||||
libbasic_static,
|
||||
libshared_static,
|
||||
libsystemd_static,
|
||||
],
|
||||
|
@ -14,7 +14,7 @@ executables += [
|
||||
'sources' : files('sysusers.c'),
|
||||
'c_args' : '-DSTANDALONE',
|
||||
'link_with' : [
|
||||
libbasic,
|
||||
libbasic_static,
|
||||
libshared_static,
|
||||
libsystemd_static,
|
||||
],
|
||||
|
@ -273,7 +273,7 @@ executables += [
|
||||
# only static linking apart from libdl, to make sure that the
|
||||
# module is linked to all libraries that it uses.
|
||||
'sources' : files('test-dlopen.c'),
|
||||
'link_with' : libbasic,
|
||||
'link_with' : libbasic_static,
|
||||
'dependencies' : libdl,
|
||||
'install' : false,
|
||||
'type' : 'manual',
|
||||
@ -408,7 +408,7 @@ executables += [
|
||||
},
|
||||
test_template + {
|
||||
'sources' : files('test-sizeof.c'),
|
||||
'link_with' : libbasic,
|
||||
'link_with' : libbasic_static,
|
||||
},
|
||||
test_template + {
|
||||
'sources' : files('test-time-util.c'),
|
||||
@ -588,7 +588,7 @@ executables += [
|
||||
test_template + {
|
||||
'sources' : files('../libsystemd/sd-device/test-sd-device-thread.c'),
|
||||
'link_with' : [
|
||||
libbasic,
|
||||
libbasic_static,
|
||||
libsystemd,
|
||||
],
|
||||
'dependencies' : threads,
|
||||
@ -596,7 +596,7 @@ executables += [
|
||||
test_template + {
|
||||
'sources' : files('../libudev/test-udev-device-thread.c'),
|
||||
'link_with' : [
|
||||
libbasic,
|
||||
libbasic_static,
|
||||
libudev,
|
||||
],
|
||||
'dependencies' : threads,
|
||||
|
@ -20,7 +20,7 @@ executables += [
|
||||
'sources' : systemd_tmpfiles_sources,
|
||||
'c_args' : '-DSTANDALONE',
|
||||
'link_with' : [
|
||||
libbasic,
|
||||
libbasic_static,
|
||||
libshared_static,
|
||||
libsystemd_static,
|
||||
],
|
||||
|
Loading…
Reference in New Issue
Block a user