Skip to content

Commit

Permalink
Make function checks more robust within shared libs
Browse files Browse the repository at this point in the history
Previous attempt to error at link like was with

1747cdf

this however causes issues with newer clang where it detects
the assignment as -Wint-conversion warning which is treated at error
and builds with clang fail. So this is an attempt to instruct
linker explicitly to error out if the symbol is not found during link
time when building a shared library, this fixes both the problems
as reported in

#23

as well as

#33 (comment)

Signed-off-by: Khem Raj <[email protected]>
  • Loading branch information
kraj committed Apr 4, 2023
1 parent 2d9712c commit 1735a78
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions Makefile.PL
Original file line number Diff line number Diff line change
Expand Up @@ -163,7 +163,8 @@ main ()
#if defined (__stub_$f) || defined (__stub___$f)
choke me
#else
f = $f ();
f = $f;
f();
#endif
;
Expand All @@ -173,7 +174,7 @@ ESQ

close(TST);
print "Looking for $f()" . "." x (13-length($f)) . " ";
if (system("$cfg{'cc'} $flags $funcs{$f} functest_$f.c > functest_$f.log 2>&1")) {
if (system("$cfg{'cc'} $flags -Wl,--no-undefined $funcs{$f} functest_$f.c > functest_$f.log 2>&1")) {
print "not found.\n";
} else {
$define{"-DHAVE_\U$f"} = undef;
Expand Down

0 comments on commit 1735a78

Please sign in to comment.