Add -mxgot flag to td_scheme on MIPS64

This fixes "relocation truncated to fit ..." error on final linking. It should
not introduce a lot of overhead since the code is used only in network
communications.

This errors appears sometimes and I do not know exact conditions, I think it is
related to large size of an object file with the schema.

More docs see at https://gcc.gnu.org/onlinedocs/gcc/MIPS-Options.html#index-mxgot-1
This commit is contained in:
Nicholas Guriev 2021-02-09 08:55:41 +03:00 committed by John Preston
parent 7e4dff25e9
commit 3a659b4b54
1 changed files with 9 additions and 0 deletions

View File

@ -33,3 +33,12 @@ PUBLIC
desktop-app::lib_base
desktop-app::lib_tl
)
if (CMAKE_SYSTEM_PROCESSOR STREQUAL "mips64")
# Sometimes final linking may fail with error "relocation truncated to fit"
# due to large scheme size.
target_compile_options(td_scheme
PRIVATE
-mxgot
)
endif()