intercept / intercept-plugin-template

A template plugin for Intercept
MIT License
1 stars 6 forks source link

Fix GNU Compiler's CMake Flag #3

Closed Soldia1138 closed 6 years ago

Soldia1138 commented 6 years ago

Fixes an issue if building for Linux. Root cause was a wrong flag for CMake.

Resulting Error: /usr/bin/x86_64-linux-gnu-ld: /usr/lib/gcc/x86_64-linux-gnu/7/crtbeginT.o: relocation R_X86_64_32 against hidden symbol `__TMC_END__' can not be used when making a shared object /usr/bin/x86_64-linux-gnu-ld: final link failed: Nonrepresentable section on output collect2: error: ld returned 1 exit status src/CMakeFiles/template-plugin_x64.dir/build.make:1004: recipe for target 'src/template-plugin_x64.so' failed CMakeFiles/Makefile2:85: recipe for target 'src/CMakeFiles/template-plugin_x64.dir/all' failed Makefile:83: recipe for target 'all' failed make[2]: *** [src/template-plugin_x64.so] Error 1 make[1]: *** [src/CMakeFiles/template-plugin_x64.dir/all] Error 2 make: *** [all] Error 2

Solution as proposed in slack by @dedmen

dedmen commented 6 years ago

What about -static-libgcc -static-libstdc++ ? I'd prefer keeping them static. Makes it easier to just give the plugin to other people who might have different versions of these locally

Soldia1138 commented 6 years ago

Good idea. Will run a test tomorrow an change PR

Soldia1138 commented 6 years ago

Works