2221b25dac
Found while compiling qtdeclarative tests: FAILED: qtdeclarative/tests/auto/qml/qmlcppcodegen/tst_qmlcppcodegen [...] ld: qtdeclarative/tests/auto/qml/qmlcppcodegen/data/TestTypes/libcodegen_test_moduleplugin.a(codegen_test_moduleplugin_TestTypesPlugin.cpp.o): non-canonical reference to canonical protected function `_Z28qml_register_types_TestTypesv' in qtdeclarative/tests/auto/qml/qmlcppcodegen/data/libcodegen_test_module.a(codegen_test_module_qmltyperegistrations.cpp.o) ld: failed to set dynamic section sizes: bad value collect2: error: ld returned 1 exit status ninja: build stopped: subcommand failed. See https://sourceware.org/bugzilla/show_bug.cgi?id=29377 Pick-to: 6.4 Change-Id: I3859764fed084846bcb0fffd1702fe6da341a9e3 Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
15 lines
683 B
CMake
15 lines
683 B
CMake
cmake_minimum_required(VERSION 3.16)
|
|
project(direct_extern_access LANGUAGES CXX)
|
|
|
|
# this is the test found in https://sourceware.org/bugzilla/show_bug.cgi?id=29087
|
|
# and https://sourceware.org/bugzilla/show_bug.cgi?id=29377
|
|
|
|
add_library(no_extern_access_lib SHARED lib.cpp)
|
|
add_executable(no_extern_access_main other.cpp main.cpp)
|
|
|
|
target_compile_options(no_extern_access_lib PRIVATE "-Werror")
|
|
target_compile_options(no_extern_access_lib PUBLIC "$<$<CXX_COMPILER_ID:GNU>:-mno-direct-extern-access>")
|
|
target_compile_options(no_extern_access_lib PUBLIC "$<$<CXX_COMPILER_ID:Clang>:-fno-direct-access-external-data>")
|
|
|
|
target_link_libraries(no_extern_access_main no_extern_access_lib)
|