[llvm-bugs] [Bug 34311] New: Improve -O argument handling
llvm-bugs at lists.llvm.org
Thu Aug 24 08:50:43 PDT 2017
Bug ID: 34311
Summary: Improve -O argument handling
Assignee: unassignedbugs at nondot.org
Reporter: emaste at freebsd.org
CC: llvm-bugs at lists.llvm.org
I am currently working through the build failures found in a FreeBSD ports
build using lld as the linker. A few ports are failing due to differences in
treatment of the -O option.
1. -O with no argument
Although not documented, ld.bfd accepts -O without an argument. Example
% ld.bfd -O string-lib.o -x -r string-lib.o
Because -O is documented as taking a number it seems reasonable to reject an
invocation with no argument. Our error message could be improved though:
% ld.lld -O
ld.lld: error: -O: number expected, but got
Even "number expected, but got ''" as produced by parseInt (vs getInteger) is a
bit more clear.
2. Space before argument
Linking is sometimes performed with something like -Wl,-O,2 passed to the
compiler driver, resulting in
% ld.bfd -O 2 string-lib.o -x -r string-lib.o
-O should just be JoinedOrSeparate perhaps?
Example failing ports: archivers/lua51-zlib, www/cgihtml
[Bug 23214] [META] Using LLD as FreeBSD's system linker
You are receiving this mail because:
You are on the CC list for the bug.
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the llvm-bugs