llvm / llvm-project

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

warning if compiling and linking using [-no]-pie #95108

Open nolange opened 5 months ago

nolange commented 5 months ago

When linking for windows you will get false warnings, see:

echo "int main() {return 0;}" | clang++ --target=x86_64-windows-gnu -x c++ -pie -

Will result in:

clang++: warning: argument unused during compilation: '-pie' [-Wunused-command-line-argument]

Despite the clang invocation doing linking. When targeting Linux there is no warning.

Using Clang 18.1.6 on Debian x86_64.

llvmbot commented 5 months ago

@llvm/issue-subscribers-clang-driver

Author: None (nolange)

When linking for windows you will get false warnings, see: ``` bash echo "int main() {return 0;}" | clang++ --target=x86_64-windows-gnu -x c++ -pie - ``` Will result in: ``` clang++: warning: argument unused during compilation: '-pie' [-Wunused-command-line-argument] ``` Despite the clang invocation doing linking. When targeting Linux there is no warning. Using Clang 18.1.6 on Debian x86_64.