1
1
Fork 0
mirror of https://github.com/QB64-Phoenix-Edition/QB64pe.git synced 2024-07-23 00:15:13 +00:00
QB64-PE/tests/compile_tests/declare_library_external/test_stripped.bas
Matthew Kilgore fac5375ea6 Fix DECLARE LIBRARY against stripped .so file
.so files can be stripped such that they contain no "regular" symbol
table but do still contain the "dynamic" symbol table, this is pretty
typical for .so files. QB64-PE is supposed to check both tables when
linking against a .so file, but a bug in ab0c2b18 meant that the second
run of nm with the -D flag to check the dynamic symbol table no longer
happens. The fix is to introduce a new output file for the dynamic run
so that they are handled separately in terms of caching the result.

A new test .so file that only contains a dynamic symbol table was added
to avoid this in the future.

Fixes: #301
2023-02-19 02:10:51 -05:00

24 lines
469 B
QBasic

$CONSOLE:ONLY
$IF LNX THEN
' This file is missing the regular symbol table and only contains the dynamic symbol table
DECLARE LIBRARY "./libstripped"
FUNCTION add_values&(BYVAL v1 AS LONG, BYVAL v2 as LONG)
END DECLARE
result = add_values&(2, 3)
PRINT result
$ELSE
' Windows can't use regular DECLARE LIBRARY to link against a dll, just skip this test
'
' Mac OS dylib files don't have a dynamic symbol table, so also nothing to test
PRINT 5
$END IF
SYSTEM