3391: Export all symbols from the main executable for the antibot r=def- a=heinrich5991

Add `-rdynamic` if supported by the linker.

Not all symbols being exported broke our builds recently, the antibot
library used `mem_comp` from the main binary but it wasn't exported,
leading to the following runtime error:

```
./DDRace64-Server_sql: symbol lookup error: /home/teeworlds/servers/libantibot.so: undefined symbol: mem_comp
```

<!-- What is the motivation for the changes of this pull request -->

## Checklist

- [ ] Tested the change ingame
- [ ] Provided screenshots if it is a visual change
- [ ] Tested in combination with possibly related configuration options
- [ ] Written a unit test if it works standalone, system.c especially
- [ ] Considered possible null pointers and out of bounds array indexing
- [ ] Changed no physics that affect existing maps
- [ ] Tested the change with [ASan+UBSan or valgrind's memcheck](https://github.com/ddnet/ddnet/#using-addresssanitizer--undefinedbehavioursanitizer-or-valgrinds-memcheck) (optional)


Co-authored-by: heinrich5991 <heinrich5991@gmail.com>
This commit is contained in:
bors[bot] 2020-12-09 10:05:39 +00:00 committed by GitHub
commit 5c7bc040e8
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -2552,6 +2552,8 @@ endmacro()
source_group_tree(src) source_group_tree(src)
if(ANTIBOT) if(ANTIBOT)
# Allow the antibot library to use functions from the server binary.
add_c_compiler_flag_if_supported(OUR_FLAGS_LINK -rdynamic)
set_own_rpath(${TARGET_SERVER}) set_own_rpath(${TARGET_SERVER})
endif() endif()