[COMMITTED] Link various tests against libm

John David Anglin dave.anglin@bell.net
Fri Oct 9 21:03:46 GMT 2026


On 2026-10-09 4:06 p.m., Thomas Schwinge wrote:
> On 2026-10-09T15:55:02-0400, John David Anglin <dave.anglin@bell.net> wrote:
>> Tested on hppa64-hp-hpux11.11.  Committed to trunk.
>> Link various tests against libm
> In my understanding, you "should", unless overridden, already be getting
> '-lm' via DejaGnu 'target.exp:default_target_compile':
> 
>     [...]
>     # This probably isn't such a good idea, but it avoids nasty
>     # hackiness in the testsuites.
>     # The math library must be linked in before the C library.  The C
>     # library is linked in by the linker script, so this must be before
>     # the linker script.
>     if {[board_info $dest exists mathlib]} {
>         append extra_ldflags " [board_info $dest mathlib]"
>     } else {
>         append extra_ldflags " -lm"
>     }
>     [...]
> 
> (I've put "should" in quotes, as I personally also consider this
> "isn't such a good idea"...)
> 
> What is different in your case, and why for these few test cases only?

I see the above hunk in dejagnu, so I have to assume the first part of the if was used
and didn't add " -lm".  Don't know why.  A fair number of tests add " -lm" in their
options.

Dave
-- 
John David Anglin  dave.anglin@bell.net


More information about the Gcc-patches mailing list