[llvm-bugs] [Bug 46612] New: Using Clang as linker warns about various command line flags, "-pg", "-no-pie", "-enable-trivial-auto-var-init-zero-knowing-it-will-be-removed-from-clang" if specified

via llvm-bugs llvm-bugs at lists.llvm.org
Mon Jul 6 15:35:41 PDT 2020


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

            Bug ID: 46612
           Summary: Using Clang as linker warns about various command line
                    flags, "-pg", "-no-pie",
                    "-enable-trivial-auto-var-init-zero-knowing-it-will-be
                    -removed-from-clang" if specified
           Product: clang
           Version: trunk
          Hardware: PC
                OS: Linux
            Status: NEW
          Severity: normal
          Priority: P
         Component: -New Bugs
          Assignee: unassignedclangbugs at nondot.org
          Reporter: keescook at chromium.org
                CC: htmldeveloper at gmail.com, llvm-bugs at lists.llvm.org,
                    neeilans at live.com, richard-llvm at metafoo.co.uk

When calling out to "ld", Clang warns about
"-enable-trivial-auto-var-init-zero-knowing-it-will-be-removed-from-clang" (and
"-pg" and "-no-pie"):

$ cat foo.c 
int global = 5;
$ clang -Wall -ftrivial-auto-var-init=zero
-enable-trivial-auto-var-init-zero-knowing-it-will-be-removed-from-clang -c -o
foo.o foo.c
$ cat link.lds
SECTIONS
{
 . = SIZEOF_HEADERS;
 .text : { *(.text) } :text
}

PHDRS
{
 text PT_LOAD FLAGS(5) FILEHDR PHDRS;
}
$ clang -Wall -ftrivial-auto-var-init=zero
-enable-trivial-auto-var-init-zero-knowing-it-will-be-removed-from-clang
-nostdlib -nostartfiles -Wl,-T,link.lds foo.o -o linked.o
clang-11: warning: argument unused during compilation:
'-enable-trivial-auto-var-init-zero-knowing-it-will-be-removed-from-clang'
[-Wunused-command-line-argument]

For example, in the Linux kernel:

https://groups.google.com/d/msg/clang-built-linux/ghiOQ5KIFug/LOmK7sJcBgAJ

-- 
You are receiving this mail because:
You are on the CC list for the bug.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-bugs/attachments/20200706/7753807f/attachment-0001.html>


More information about the llvm-bugs mailing list