This is an archive of the discontinued LLVM Phabricator instance.

[test-suite] Fix unix-smail symbol clash with the symbols in libc when linking statically.
ClosedPublic

Authored by mstojanovic on Nov 15 2017, 6:18 AM.

Details

Summary

Test unix-smail fails when compiling with --static flag. Adding a prefix to getopt, optind and opterr in order to avoid clashing with libc while linking.

Diff Detail

Repository
rL LLVM

Event Timeline

mstojanovic created this revision.Nov 15 2017, 6:18 AM
MatzeB edited edge metadata.Nov 15 2017, 4:14 PM

Does this work with all linkers? I don't see this document in the manpage of apples ld64.

I'd be fine with renaming the functions in the benchmark.

This was only tested with gcc for mips and x86_64 but renaming the function and the variables would be a more general solution.

Since I don't perceive a requirement that the benchmark source continue to exactly match that of the original, I would prefer just changing the benchmark source to not conflict.

mstojanovic retitled this revision from [test-suite] Fix symbol clash of getopt, optind, opterr with the symbols in libc when linking statically. to [test-suite] Fix unix-smail symbol clash with the symbols in libc when linking statically..
mstojanovic edited the summary of this revision. (Show Details)

Added unix-smail_ prefix to function getopt and variables optind and opterr.

MatzeB accepted this revision.Nov 16 2017, 5:20 PM

LGTM, thanks.

This revision is now accepted and ready to land.Nov 16 2017, 5:20 PM
This revision was automatically updated to reflect the committed changes.