https://bugs.llvm.org/show_bug.cgi?id=49536
Bug ID: 49536
Summary: #pragma comment(lib) not ignored with MS extensions
disabled
Product: clang
Version: trunk
Hardware: PC
OS: Linux
Status: NEW
Severity: normal
Priority: P
Component: -New Bugs
Assignee: unassignedclangb...@nondot.org
Reporter: c.scha...@t-online.de
CC: htmldevelo...@gmail.com, llvm-bugs@lists.llvm.org,
neeil...@live.com, richard-l...@metafoo.co.uk
Even without MS extensions, Clang still follows the #pragma comment (lib)
directive.
According to the documentation [1], they should per default only be active on
Windows platforms. However, on Linux and even with -fno-ms-extensions
explicitly set, the directive is still followed.
The source code
#pragma comment(lib, "testlib.lib")
int main() {
return 0;
}
compiles to the following assembly:
.text
.file "test.cpp"
.globl main # -- Begin function main
.p2align 4, 0x90
.type main,@function
main: # @main
.cfi_startproc
# %bb.0:
xorl %eax, %eax
retq
.Lfunc_end0:
.size main, .Lfunc_end0-main
.cfi_endproc
# -- End function
.section .deplibs,"MS",@llvm_dependent_libraries,1
.ascii "testlib.lib"
.byte 0
.ident "clang version 13.0.0 (https://github.com/llvm/llvm-project
bc5e9ec2dccdd18f840a09fe63c196ae25ad99d5)"
.section ".note.GNU-stack","",@progbits
.addrsig
This behavior causes linker errors with LLD.
[1] https://clang.llvm.org/docs/UsersManual.html#microsoft-extensions
--
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