2.41 branch approaching

Matthias Klose doko@debian.org
Wed Jun 28 16:27:32 GMT 2023


On 28.06.23 17:59, Nick Clifton via Binutils wrote:
> Hi Matthias,
> 
>>> Can you supply the binutils.log file for a failing test run so
>>> that I can take a look ?
>>
>> attached, however it only points to the first fail in these two test cases.
> Hmm, OK, so if I am reading the log correctly the addr2line failures are
> happening because running:
> 
>    addr2line -e tmpdir/testprog <some address>
> 
> returns:
> 
>    ./builddir-single/binutils/./binutils/testsuite/binutils-all/testprog.c:<some 
> line number>
> 
> whereas the regexp is expecting to match:
> 
>   "$srcdir/$subdir/testprog.c:\[0-9\]+"
> 
> which translates to:
> 
>    
> /home/packages/binutils/binutils-2.40.50.20230628/binutils/testsuite/binutils-all/testprog.c:[0-9]+
> 
> Looking back in the log I notice that the test program is being compiled
> with:
> 
>    x86_64-linux-gnu-gcc \
>     
> /home/packages/binutils/binutils-2.40.50.20230628/binutils/testsuite/binutils-all/testprog.c \
>     -g \
>     -O2 \
>     -ffile-prefix-map=/home/packages/binutils/binutils-2.40.50.20230628=. \
>     -O0 \
>     -g \
>     -lm \
>     -o tmpdir/testprog
> 
> (I added the backslash line separators).
> 
> And so the culprit appears to be the -ffile-prefix-map... option.  Which I think
> must be coming from your environment as it is not a normal part of the binutils
> testsuite.
> 
> Does this make sense ?

yes, this is passed by the general Debian build env:

$ dpkg-buildflags
ASFLAGS=
CFLAGS=-g -O2 
-ffile-prefix-map=/home/packages/binutils/binutils-2.40.50.20230628=. 
-fstack-protector-strong -Wformat -Werror=format-security
CPPFLAGS=-Wdate-time -D_FORTIFY_SOURCE=2
CXXFLAGS=-g -O2 
-ffile-prefix-map=/home/packages/binutils/binutils-2.40.50.20230628=. 
-fstack-protector-strong -Wformat -Werror=format-security
DFLAGS=-frelease
FCFLAGS=-g -O2 
-ffile-prefix-map=/home/packages/binutils/binutils-2.40.50.20230628=. 
-fstack-protector-strong
FFLAGS=-g -O2 
-ffile-prefix-map=/home/packages/binutils/binutils-2.40.50.20230628=. 
-fstack-protector-strong
GCJFLAGS=-g -O2 
-ffile-prefix-map=/home/packages/binutils/binutils-2.40.50.20230628=. 
-fstack-protector-strong
LDFLAGS=-Wl,-z,relro
OBJCFLAGS=-g -O2 
-ffile-prefix-map=/home/packages/binutils/binutils-2.40.50.20230628=. 
-fstack-protector-strong -Wformat -Werror=format-security
OBJCXXFLAGS=-g -O2 
-ffile-prefix-map=/home/packages/binutils/binutils-2.40.50.20230628=. 
-fstack-protector-strong -Wformat -Werror=format-security

these flags are set to ensure reproducible builds, and to inject hardening 
compiler flags.

> I suspect that the same problem explains why the objdump+source+listing tests
> are failing.  The sources are not where the built binaries are saying that they
> should be.

these injected flags are nothing new, I just fail to understand why these tests 
are failing now, and not before. I don't see any changes in the tests, and 2.40 
passed these tests with the same flags.

Matthias



More information about the Binutils mailing list