llvm / llvm-project

The LLVM Project is a collection of modular and reusable compiler and toolchain technologies.
http://llvm.org
Other
28.59k stars 11.82k forks source link

error: unsupported option '-frecord-command-line' for target 'x86_64-w64-windows-gnu' #104719

Open pmor13 opened 2 months ago

pmor13 commented 2 months ago

Scenario:

$ cat t1.c
int main(void){}

$ ~/NDK/toolchains/llvm/prebuilt/windows-x86_64/bin/clang t1.c -c

$ ~/NDK/toolchains/llvm/prebuilt/windows-x86_64/bin/clang t1.c -c -frecord-command-line
clang: error: unsupported option '-frecord-command-line' for target 'x86_64-w64-windows-gnu'

# O_o

$ cat NDK/source.properties
Pkg.Desc = Android NDK
Pkg.Revision = 23.1.7779620

How -frecord-command-line is related to target x86_64-w64-windows-gnu?

I thought that -frecord-command-line is target independent.

Is this Clang / LLVM issue or Android NDK issue?

MaskRay commented 2 months ago

-frecord-command-line (alias: -frecord-gcc-switches) requirements implementation for each object file format. We need to decide the section name, flags, content, etc.

In GCC, https://gcc.gnu.org/onlinedocs/gccint/File-Framework.html#index-TARGET_005fASM_005fRECORD_005fGCC_005fSWITCHES this option is only implemented for ELF.

% x86_64-w64-mingw32-gcc -c -frecord-gcc-switches -c x.c
cc1: note: ‘-frecord-gcc-switches’ is not supported by the current target