https://bugs.llvm.org/show_bug.cgi?id=34311

            Bug ID: 34311
           Summary: Improve -O argument handling
           Product: lld
           Version: unspecified
          Hardware: PC
                OS: FreeBSD
            Status: NEW
          Severity: enhancement
          Priority: P
         Component: ELF
          Assignee: unassignedb...@nondot.org
          Reporter: ema...@freebsd.org
                CC: llvm-bugs@lists.llvm.org
            Blocks: 23214

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
invocation:

% 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


Referenced Bugs:

https://bugs.llvm.org/show_bug.cgi?id=23214
[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.
_______________________________________________
llvm-bugs mailing list
llvm-bugs@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-bugs

Reply via email to