Bug 30082 - ld-bootstrap/bootstrap.exp should use LDFLAGS not CFLAGS
Summary: ld-bootstrap/bootstrap.exp should use LDFLAGS not CFLAGS
Status: RESOLVED FIXED
Alias: None
Product: binutils
Classification: Unclassified
Component: binutils (show other bugs)
Version: 2.41
: P2 normal
Target Milestone: ---
Assignee: Not yet assigned to anyone
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2023-02-05 13:00 UTC by Romain Geissler
Modified: 2023-02-07 18:14 UTC (History)
0 users

See Also:
Host:
Target:
Build:
Last reconfirmed:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Romain Geissler 2023-02-05 13:00:58 UTC
Hi,

I have a new test failure when moving from binutils 2.39 to 2.40, all the bootstap tests fail. Checking the logs, it fails because the lib "-lzstd" can't be found at link time.

Checking the code in ld-bootstrap/bootstrap.exp it seems these bootstrap link tests are done using $CFLAGS, while in my case the right "-L/path/to/libzsd" are in $LDFLAGS. Isn't it strange that bootstrap.exp uses CFLAGS while it doesn't compile anything, but tries to link things ? I tried to replace CFLAGS by LDFLAGS, but it seems LDFLAGS isn't passed to DejaGNU's runtest, so it doesn't work either. Instead I have copied my "-L" flag from LDFLAGS to CFLAGS, but it seems more a workaround than an actual fix.

Cheers,
Romain
Comment 1 Romain Geissler 2023-02-05 15:17:39 UTC
Patch posted here: https://sourceware.org/pipermail/binutils/2023-February/125912.html
Comment 2 Romain Geissler 2023-02-07 18:14:52 UTC
Hi,

My initial issue is fixed (as it was only about not being able to find the zstd lib installed in a non standard location).

Despite not passing LDFLAGS to this tests, at least we pass the right library flags, so I would say that is enough for now and we can close this ticket.

Cheers,
Romain