[Bug binutils/21479] strip doesn't handle lto archives

2025-05-03 Thread sam at gentoo dot org
https://sourceware.org/bugzilla/show_bug.cgi?id=21479

Sam James  changed:

   What|Removed |Added

 CC||hjl.tools at gmail dot com

--- Comment #2 from Sam James  ---
H.J., would you be willing to take a look? It is one of the last annoyances
left downstream for us. We can live with it if it is too hard, though. I can
also have a go if it is as simple as just adding the basic plugin infra, but I
am not sure if there's a reason it hasn't been done.

-- 
You are receiving this mail because:
You are on the CC list for the bug.


[Bug binutils/21479] strip doesn't handle lto archives

2025-05-03 Thread hjl.tools at gmail dot com
https://sourceware.org/bugzilla/show_bug.cgi?id=21479

H.J. Lu  changed:

   What|Removed |Added

   Assignee|unassigned at sourceware dot org   |hjl.tools at gmail dot 
com
 Status|NEW |WAITING

--- Comment #3 from H.J. Lu  ---
Created attachment 16064
  --> https://sourceware.org/bugzilla/attachment.cgi?id=16064&action=edit
A patch

Please try this.

-- 
You are receiving this mail because:
You are on the CC list for the bug.


[Bug binutils/31611] bfd: bfdio using shlwapi (win32) functionality without linking

2025-05-03 Thread sam at gentoo dot org
https://sourceware.org/bugzilla/show_bug.cgi?id=31611

Sam James  changed:

   What|Removed |Added

   See Also||https://sourceware.org/bugz
   ||illa/show_bug.cgi?id=31527

-- 
You are receiving this mail because:
You are on the CC list for the bug.


[Bug binutils/31527] gdb is not working for UNC path

2025-05-03 Thread sam at gentoo dot org
https://sourceware.org/bugzilla/show_bug.cgi?id=31527

Sam James  changed:

   What|Removed |Added

   See Also||https://sourceware.org/bugz
   ||illa/show_bug.cgi?id=31611

-- 
You are receiving this mail because:
You are on the CC list for the bug.


[Bug binutils/21479] strip doesn't handle lto archives

2025-05-03 Thread hjl.tools at gmail dot com
https://sourceware.org/bugzilla/show_bug.cgi?id=21479

H.J. Lu  changed:

   What|Removed |Added

  Attachment #16066|0   |1
is obsolete||

--- Comment #8 from H.J. Lu  ---
Created attachment 16067
  --> https://sourceware.org/bugzilla/attachment.cgi?id=16067&action=edit
An updated patch

Please try this.

-- 
You are receiving this mail because:
You are on the CC list for the bug.


[Bug binutils/21479] strip doesn't handle lto archives

2025-05-03 Thread hjl.tools at gmail dot com
https://sourceware.org/bugzilla/show_bug.cgi?id=21479

H.J. Lu  changed:

   What|Removed |Added

  Attachment #16065|0   |1
is obsolete||

--- Comment #5 from H.J. Lu  ---
Created attachment 16066
  --> https://sourceware.org/bugzilla/attachment.cgi?id=16066&action=edit
A patch with tests

-- 
You are receiving this mail because:
You are on the CC list for the bug.


[Bug binutils/21479] strip doesn't handle lto archives

2025-05-03 Thread sam at gentoo dot org
https://sourceware.org/bugzilla/show_bug.cgi?id=21479

--- Comment #6 from Sam James  ---
Thank you! So far, it looks good. I am testing more.

A question: when strip has no plugin support (like in 2.44), `strip -R
'.gnu.lto_*' -R '.gnu.debuglto_*' -N __gnu_lto_v1 a.o` where a.o is a fat LTO
object from -ffat-lto-objects will make a.o a regular object file, as if it
wasn't built with LTO. This is useful for distributing because we don't know
what compiler or version will be used to link against it later. What's the best
way to do this with strip?

i.e.

a.c:
```
int foo();

int foo() {
return 42;
}
```

main.c:
```
#include 

int foo();

int main() {
printf("Got magic number: %d\n", foo());
return 0;
}
```

This works:
```
gcc a.c -O2 -flto -ffat-lto-objects -c
/usr/x86_64-pc-linux-gnu/binutils-bin/2.44/strip -R '.gnu.lto_*' -R
'.gnu.debuglto_*' -N __gnu_lto_v1 a.o
clang -O2 -flto -ffat-lto-objects -fuse-ld=mold main.c a.o -o main && ./main
```

This doesn't:
```
gcc a.c -O2 -flto -ffat-lto-objects -c
/usr/x86_64-pc-linux-gnu/binutils-bin//strip -R '.gnu.lto_*' -R
'.gnu.debuglto_*' -N __gnu_lto_v1 a.o # strip with patch
clang -O2 -flto -ffat-lto-objects -fuse-ld=mold main.c a.o -o main && ./main
```

This works (i.e. add --plugin=/dev/null when we want it to be dumb):
```
gcc a.c -O2 -flto -ffat-lto-objects -c
ar qv a.a a.o
/usr/x86_64-pc-linux-gnu/binutils-bin//strip -R '.gnu.lto_*' -R
'.gnu.debuglto_*' -N __gnu_lto_v1 a.a --plugin=/dev/null # strip with patch
clang -O2 -flto -ffat-lto-objects -fuse-ld=mold main.c a.a -o main && ./main
```

But that workaround/fix doesn't work for archives:
```
gcc a.c -O2 -flto -ffat-lto-objects -c
ar qv a.a a.o
/usr/x86_64-pc-linux-gnu/binutils-bin//strip -R '.gnu.lto_*' -R
'.gnu.debuglto_*' -N __gnu_lto_v1 a.a --plugin=/dev/null # strip with patch
clang -O2 -flto -ffat-lto-objects -fuse-ld=mold main.c a.a -o main && ./main
```

strip is trying to do the right thing, and the LTO plugin claims the whole
object, then -R can't do anything. --plugin=/dev/null doesn't help there when
we have a archive .a instead of .o. Do we need a special option just for
stripping LTO sections (rather than passing them as arbitrary strings)? (I
don't need to strip arbitrary sections, just to strip out bytecode for LTO to
make archives generic.)

-- 
You are receiving this mail because:
You are on the CC list for the bug.


[Bug binutils/21479] strip doesn't handle lto archives

2025-05-03 Thread sam at gentoo dot org
https://sourceware.org/bugzilla/show_bug.cgi?id=21479

--- Comment #7 from Sam James  ---
(In reply to Sam James from comment #6)
> 
> strip is trying to do the right thing, and the LTO plugin claims the whole
> object, then -R can't do anything. --plugin=/dev/null doesn't help there
> when we have a archive .a instead of .o. Do we need a special option just
> for stripping LTO sections (rather than passing them as arbitrary strings)?
> (I don't need to strip arbitrary sections, just to strip out bytecode for
> LTO to make archives generic.)

LLVM has llvm-bitcode-strip for this which only strips bytecode.

-- 
You are receiving this mail because:
You are on the CC list for the bug.


[Bug binutils/32340] strip has difficulty handling the relocations in .rel.llvm.call-graph-profile

2025-05-03 Thread sam at gentoo dot org
https://sourceware.org/bugzilla/show_bug.cgi?id=32340

Sam James  changed:

   What|Removed |Added

   See Also||https://sourceware.org/bugz
   ||illa/show_bug.cgi?id=31872
 CC||amodra at gmail dot com

-- 
You are receiving this mail because:
You are on the CC list for the bug.


[Bug binutils/31872] Segfault in objdump (elf_slurp_reloc_table_from_section)

2025-05-03 Thread sam at gentoo dot org
https://sourceware.org/bugzilla/show_bug.cgi?id=31872

Sam James  changed:

   What|Removed |Added

   See Also||https://sourceware.org/bugz
   ||illa/show_bug.cgi?id=32340

-- 
You are receiving this mail because:
You are on the CC list for the bug.


[Bug binutils/32340] strip has difficulty handling the relocations in .rel.llvm.call-graph-profile

2025-05-03 Thread sam at gentoo dot org
https://sourceware.org/bugzilla/show_bug.cgi?id=32340

--- Comment #2 from Sam James  ---
Oh, Jan's fix from https://sourceware.org/bugzilla/show_bug.cgi?id=31872#c3 may
do this, actually.

-- 
You are receiving this mail because:
You are on the CC list for the bug.


[Bug binutils/32340] strip has difficulty handling the relocations in .rel.llvm.call-graph-profile

2025-05-03 Thread sam at gentoo dot org
https://sourceware.org/bugzilla/show_bug.cgi?id=32340

--- Comment #3 from Sam James  ---
Can you upload a copy of kvm.ko?

-- 
You are receiving this mail because:
You are on the CC list for the bug.


[Bug binutils/32935] Zlib failed to build on MacOS

2025-05-03 Thread sam at gentoo dot org
https://sourceware.org/bugzilla/show_bug.cgi?id=32935

Sam James  changed:

   What|Removed |Added

 CC||sam at gentoo dot org

--- Comment #1 from Sam James  ---
It should be fixed when https://gcc.gnu.org/bugzilla/show_bug.cgi?id=105404 is,
then synced back.

-- 
You are receiving this mail because:
You are on the CC list for the bug.


[Bug binutils/32935] Zlib failed to build on MacOS

2025-05-03 Thread sam at gentoo dot org
https://sourceware.org/bugzilla/show_bug.cgi?id=32935

Sam James  changed:

   What|Removed |Added

   See Also||https://sourceware.org/bugz
   ||illa/show_bug.cgi?id=32933,
   ||https://gitlab.rtems.org/rt
   ||ems/tools/rtems-source-buil
   ||der/-/issues/98

-- 
You are receiving this mail because:
You are on the CC list for the bug.


[Bug binutils/32935] Zlib failed to build on MacOS for binutils

2025-05-03 Thread sam at gentoo dot org
https://sourceware.org/bugzilla/show_bug.cgi?id=32935

Sam James  changed:

   What|Removed |Added

Summary|Zlib failed to build on |Zlib failed to build on
   |MacOS   |MacOS for binutils

-- 
You are receiving this mail because:
You are on the CC list for the bug.


[Bug binutils/32935] Zlib failed to build on MacOS for binutils

2025-05-03 Thread sam at gentoo dot org
https://sourceware.org/bugzilla/show_bug.cgi?id=32935

Sam James  changed:

   What|Removed |Added

   See Also||https://gcc.gnu.org/bugzill
   ||a/show_bug.cgi?id=105404

-- 
You are receiving this mail because:
You are on the CC list for the bug.


[Bug binutils/24400] ia64: binutils regression leads to gcc stage2/stage3 compare failure

2025-05-03 Thread sam at gentoo dot org
https://sourceware.org/bugzilla/show_bug.cgi?id=24400

Sam James  changed:

   What|Removed |Added

 Status|UNCONFIRMED |RESOLVED
 Resolution|--- |INVALID

--- Comment #2 from Sam James  ---
Per above.

-- 
You are receiving this mail because:
You are on the CC list for the bug.


[Bug binutils/21479] strip doesn't handle lto archives

2025-05-03 Thread hjl.tools at gmail dot com
https://sourceware.org/bugzilla/show_bug.cgi?id=21479

H.J. Lu  changed:

   What|Removed |Added

  Attachment #16064|0   |1
is obsolete||

--- Comment #4 from H.J. Lu  ---
Created attachment 16065
  --> https://sourceware.org/bugzilla/attachment.cgi?id=16065&action=edit
An updated patch

-- 
You are receiving this mail because:
You are on the CC list for the bug.


[Bug binutils/21479] strip doesn't handle lto archives

2025-05-03 Thread hjl.tools at gmail dot com
https://sourceware.org/bugzilla/show_bug.cgi?id=21479

H.J. Lu  changed:

   What|Removed |Added

   Target Milestone|--- |2.45

-- 
You are receiving this mail because:
You are on the CC list for the bug.


[Bug binutils/32935] New: Zlib failed to build on MacOS

2025-05-03 Thread chrisj at rtems dot org
https://sourceware.org/bugzilla/show_bug.cgi?id=32935

Bug ID: 32935
   Summary: Zlib failed to build on MacOS
   Product: binutils
   Version: 2.44
Status: UNCONFIRMED
  Severity: normal
  Priority: P2
 Component: binutils
  Assignee: unassigned at sourceware dot org
  Reporter: chrisj at rtems dot org
  Target Milestone: ---

Zlib fails to build on MacOS. The details are the same issue raised for gdb
(see #32933).

The breakage was reported by an RTEMS user. The issue is
https://gitlab.rtems.org/rtems/tools/rtems-source-builder/-/issues/98

-- 
You are receiving this mail because:
You are on the CC list for the bug.