[llvm-bugs] [Bug 45661] New: llvm-ar works wrong with thin archives containing object files of same name
via llvm-bugs
llvm-bugs at lists.llvm.org
Fri Apr 24 06:21:21 PDT 2020
https://bugs.llvm.org/show_bug.cgi?id=45661
Bug ID: 45661
Summary: llvm-ar works wrong with thin archives containing
object files of same name
Product: lld
Version: unspecified
Hardware: All
OS: Linux
Status: NEW
Severity: enhancement
Priority: P
Component: All Bugs
Assignee: unassignedbugs at nondot.org
Reporter: qwertytmp1 at gmail.com
CC: llvm-bugs at lists.llvm.org, smithp352 at googlemail.com
For simplicity, I've prepared several bash files designed to be some sort of
PoC.
0.prepare_object_files.sh
```
#!/bin/bash
mkdir -p keyboard
mkdir -p mouse
touch keyboard/click.o
touch mouse/click.o
```
1.create_thin_archive.sh
```
#!/bin/bash
# set 1st argument as binutil's ar or llvm-ar
AR="$1"
rm -f mouse/built-in.o
rm -f keyboard/built-in.o
rm -f built-in.o
$AR -rcST mouse/built-in.o mouse/click.o \
&& \
$AR -rcST keyboard/built-in.o keyboard/click.o \
&& \
$AR -rcST built-in.o mouse/built-in.o keyboard/built-in.o \
&& \
cat built-in.o
```
To prepare environment (.o files and folders) run:
```
./0.prepare_object_files.sh
```
After this, run PoC with binutil's ar:
```
./1.create_thin_archive.sh ar
```
we'll get following output:
```
!<thin>
// 34 `
mouse/click.o/
keyboard/click.o/
...
```
After we run PoC with llvm-ar:
```
./1.create_thin_archive.sh llvm-ar
```
we'll get following output:
```
!<thin>
// 18 `
click.o/
click.o/
...
```
And here is a problem.
Both click.o files located at the same directory level inside of thin archive,
generated by llvm-ar.
--
You are receiving this mail because:
You are on the CC list for the bug.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-bugs/attachments/20200424/46adf032/attachment.html>
More information about the llvm-bugs
mailing list