Skip to content

emar adds object files twice #8670

Closed

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..

Activity

  1. kripken commented on May 24, 2019

    @kripken
    Member
  2. self-assigned this
    on May 25, 2019
  3. sbc100 commented on May 25, 2019

    @sbc100
    Collaborator

    Yup, looks like an oversight on my part here.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

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