diff --git a/src/static_template/meson.build b/src/static_template/meson.build index 88ad57a56df7f49a2b39dececad68f82ef6e1b8a..359a2f2a7db46b1e7a5bf4af7470e58422f2bf5e 100644 --- a/src/static_template/meson.build +++ b/src/static_template/meson.build @@ -7,7 +7,13 @@ temp_cflags = ['-O2', '-Wall', '-Wextra', '-Wformat', '-D_GNU_SOURCE', '-fno-jum '-Wno-nonnull', '-Wno-unused-variable', '-Wno-stringop-truncation', '-Wno-unused-result', '-D_FORTIFY_SOURCE=2'] +libc_ver=run_command('rpm', '-qi', 'glibc', check: true).stdout().strip() +# openEuler 2309 +if libc_ver.contains('2.38') + temp_cflags += ['-DGLIBC236'] +endif + executable('sysboost_static_template', sources, install: true, c_args: temp_cflags, - link_args: temp_cflags + ['-Wl,--emit-relocs', '-ldl']) \ No newline at end of file + link_args: temp_cflags + ['-Wl,--emit-relocs', '-ldl']) diff --git a/src/static_template/static_template.c b/src/static_template/static_template.c index 4db83bfb42fccf8155bced0c5cbcd558a117e6e9..a7f34dc4105fef3d5e62a899acaf545e57ccaa3f 100644 --- a/src/static_template/static_template.c +++ b/src/static_template/static_template.c @@ -113,7 +113,12 @@ int main(void) NO_COMPILE_OPTIMIZE("sigfillset"); NO_COMPILE_OPTIMIZE("siglongjmp"); NO_COMPILE_OPTIMIZE("vfprintf"); + +#ifdef GLIBC236 + // arc4random@@GLIBC_2.36 NO_COMPILE_OPTIMIZE("arc4random"); +#endif + NO_COMPILE_OPTIMIZE("optarg"); NO_COMPILE_OPTIMIZE("getopt_long"); NO_COMPILE_OPTIMIZE("error");