Fix configure --as-shared-lib
This commit is contained in:
parent
a63ffba266
commit
0d92da5d7e
11
configure
vendored
11
configure
vendored
@ -835,6 +835,7 @@ if test "$mingw32" = "yes" ; then
|
||||
fi
|
||||
|
||||
werror=""
|
||||
as_shared_lib="no"
|
||||
|
||||
for opt do
|
||||
optarg=$(expr "x$opt" : 'x[^=]*=\(.*\)')
|
||||
@ -1582,9 +1583,9 @@ for opt do
|
||||
--disable-slirp-smbd) slirp_smbd=no
|
||||
;;
|
||||
--as-shared-lib)
|
||||
QEMU_LDFLAGS="$QEMU_LDFLAGS -shared"
|
||||
QEMU_CFLAGS="QEMU_CFLAGS -fPIC -DAS_SHARED_LIB=1"
|
||||
QEMU_CXXFLAGS="QEMU_CXXFLAGS -fPIC -DAS_SHARED_LIB=1"
|
||||
as_shared_lib="yes"
|
||||
QEMU_CFLAGS="$QEMU_CFLAGS -fPIC -DAS_SHARED_LIB=1"
|
||||
QEMU_CXXFLAGS="$QEMU_CXXFLAGS -fPIC -DAS_SHARED_LIB=1"
|
||||
;;
|
||||
*)
|
||||
echo "ERROR: unknown option $opt"
|
||||
@ -4923,6 +4924,10 @@ if test "$secret_keyring" = "yes" ; then
|
||||
echo "CONFIG_SECRET_KEYRING=y" >> $config_host_mak
|
||||
fi
|
||||
|
||||
if test "$as_shared_lib" = "yes" ; then
|
||||
echo "AS_SHARED_LIB=y" >> $config_host_mak
|
||||
fi
|
||||
|
||||
echo "ROMS=$roms" >> $config_host_mak
|
||||
echo "MAKE=$make" >> $config_host_mak
|
||||
echo "PYTHON=$python" >> $config_host_mak
|
||||
|
@ -656,7 +656,7 @@ int libafl_qemu_run(void)
|
||||
|
||||
#ifdef AS_SHARED_LIB
|
||||
int qemu_user_init(int argc, char **argv, char **envp);
|
||||
__attribute__((section(".init_array"))) static void *ctr = &qemu_user_init;
|
||||
__attribute__((section(".init_array"))) void *_qemu_user_init_ctr = &qemu_user_init;
|
||||
|
||||
int qemu_user_init(int argc, char **argv, char **envp)
|
||||
#else
|
||||
|
17
meson.build
17
meson.build
@ -2656,15 +2656,26 @@ foreach target : target_dirs
|
||||
exe_name += '-unsigned'
|
||||
endif
|
||||
|
||||
emulator = executable(exe_name, exe['sources'],
|
||||
if 'AS_SHARED_LIB' in config_host
|
||||
emulator = shared_library(exe_name, exe['sources'],
|
||||
install: true,
|
||||
c_args: c_args,
|
||||
dependencies: arch_deps + deps + exe['dependencies'],
|
||||
objects: lib.extract_all_objects(recursive: true),
|
||||
link_language: link_language,
|
||||
link_depends: [block_syms, qemu_syms] + exe.get('link_depends', []),
|
||||
link_args: link_args,
|
||||
gui_app: exe['gui'])
|
||||
link_args: link_args)
|
||||
else
|
||||
emulator = executable(exe_name, exe['sources'],
|
||||
install: true,
|
||||
c_args: c_args,
|
||||
dependencies: arch_deps + deps + exe['dependencies'],
|
||||
objects: lib.extract_all_objects(recursive: true),
|
||||
link_language: link_language,
|
||||
link_depends: [block_syms, qemu_syms] + exe.get('link_depends', []),
|
||||
link_args: link_args,
|
||||
gui_app: exe['gui'])
|
||||
endif
|
||||
|
||||
if targetos == 'darwin'
|
||||
icon = 'pc-bios/qemu.rsrc'
|
||||
|
Loading…
x
Reference in New Issue
Block a user