Skip to content

emar adds object files twice #8670

@digimatic

Description

@digimatic

The latest commit of emar.py (d8d121e) causes entries to be duplicated instead of replaced.

Example:
$ rm -f lib/libCore.a
$ emar rc lib/libCore.a Mobile/Core/CMakeFiles/Core.dir/src/Runtime.cpp.o
$ emar tv lib/libCore.a
rw-r--r-- 0/0 2905028 1970-01-01 01:00:00.000000000 Runtime.cpp.o
$ emar rc lib/libCore.a Mobile/Core/CMakeFiles/Core.dir/src/Runtime.cpp.o
$ emar tv lib/libCore.a
rw-r--r-- 0/0 2905028 1970-01-01 01:00:00.000000000 Runtime.cpp.o
rw-r--r-- 0/0 2905028 1970-01-01 01:00:00.000000000 Runtime_3bf7fd6a.cpp.o
$ emar rc lib/libCore.a Mobile/Core/CMakeFiles/Core.dir/src/Runtime.cpp.o
$ emar tv lib/libCore.a
rw-r--r-- 0/0 2905028 1970-01-01 01:00:00.000000000 Runtime.cpp.o
rw-r--r-- 0/0 2905028 1970-01-01 01:00:00.000000000 Runtime_3bf7fd6a.cpp.o

I tested emar.py 965bdd9, and that makes the lib contain only Runtime_3bf7fd6a.cpp.o.

This causes problem in a normal build cycle. When a .cpp is changed it is recompiled and added into the archive again. But the second time with a new name (mangled). The linker may still resolve using the first object file it finds, that is the old object file. So the final binary is having the old behavior before the cpp was modified..

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions