diff --git a/meson.build b/meson.build index 77bd8288c..ef89b56d1 100644 --- a/meson.build +++ b/meson.build @@ -208,10 +208,13 @@ else '-fomit-frame-pointer', ] endif - if copt_platform == 'mac' + if copt_platform == 'mac' and uopt_static == 'prebuilt' args_ccomp += [ '-mmacosx-version-min=10.9' ] project_link_args += [ '-mmacosx-version-min=10.9' ] endif + if copt_platform == 'lin' and not get_option('b_pie') and get_option('workaround_gcc_no_pie') # nice one, meson + project_link_args += [ '-no-pie' ] + endif project_c_args += args_ccomp project_cpp_args += args_ccomp + [ '-Wno-invalid-offsetof' ] endif diff --git a/meson_options.txt b/meson_options.txt index babfeb3cc..d7db98ee9 100644 --- a/meson_options.txt +++ b/meson_options.txt @@ -165,3 +165,9 @@ option( value: '', description: 'Update server, only used by snapshots and mods, see \'snapshot_id\' and \'mod_id\'' ) +option( + 'workaround_gcc_no_pie', + type: 'boolean', + value: true, + description: 'Pass -no-pie to gcc manually to work around meson\'s -Db_pie=false doing nothing' +)