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

            Bug ID: 48878
           Summary: -MP argument not working properly
           Product: clang
           Version: unspecified
          Hardware: PC
                OS: Linux
            Status: NEW
          Severity: normal
          Priority: P
         Component: C++
          Assignee: unassignedclangb...@nondot.org
          Reporter: j...@overdrivepizza.com
                CC: blitzrak...@gmail.com, dgre...@apple.com,
                    erik.pilking...@gmail.com, llvm-bugs@lists.llvm.org,
                    richard-l...@metafoo.co.uk

The following bug was noticed when compiling glibc (grte branch) with clang. It
seems that -MP does not output the path to cstdlib when the input is not a
file.

Glibc's configure (line 5488) file tries to run the following line as an
attempt to retrieve the path to cstdlib ($1 expands to cstdlib):

    echo "#include <$1>" | $CXX -M -MP -x c++ - 2>/dev/null \
   | sed -n "\,$1:,{s/:\$//;p}"

But this doesn't return a path to cstdlib. This was verified to work properly
with GCC.

If the configure is changed to something like:

    echo "#include <$1>" &> tmp.cpp
    $CXX -M -MP -x c++ tmp.cpp 2>/dev/null | sed -n "\,$1:,{s/:\$//;p}"

The path to cstdlib is properly found.

This behavior was observed on fedora 33.

-- 
You are receiving this mail because:
You are on the CC list for the bug.
_______________________________________________
llvm-bugs mailing list
llvm-bugs@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-bugs

Reply via email to