Date: Mon, 09 Nov 2020 22:18:57 +0000 From: bugzilla-noreply@freebsd.org To: bugs@FreeBSD.org Subject: [Bug 250992] Binaries produced by clang -pg on x86-64 always crash in ld-elf.so.1 Message-ID: <bug-250992-227-2HpP9TamP8@https.bugs.freebsd.org/bugzilla/> In-Reply-To: <bug-250992-227@https.bugs.freebsd.org/bugzilla/> References: <bug-250992-227@https.bugs.freebsd.org/bugzilla/>
next in thread | previous in thread | raw e-mail | index | archive | help
https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=3D250992 --- Comment #2 from Oleg Derevenetz <oleg.derevenetz@gmail.com> --- I found similar bug report in LLVM bugtracker: https://bugs.llvm.org/show_bug.cgi?id=3D47455 with some discussion. According to truss output, the -dynamic-linker flag is actually being passed to lld: 890: execve("/usr/bin/clang",[ "/usr/bin/clang", "-cc1", "-triple", "x86_64-unknown-freebsd12.2", "-emit-obj", "-mrelax-all", "-disable-free", "-disable-llvm-verifier", "-discard-value-names", "-main-file-name", "test.= c", "-mrelocation-model", "static", "-mthread-model", "posix", "-mframe-pointer=3Dall", "-fno-rounding-math", "-masm-verbose", "-mconstructor-aliases", "-munwind-tables", "-target-cpu", "x86-64", "-dwarf-column-info", "-fno-split-dwarf-inlining", "-debugger-tuning=3Dgdb", "-resource-dir", "/usr/lib/clang/10.0.1", "-fdebug-compilation-dir", "/usr/home/oleg/tmp/pg", "-ferror-limit", "19", "-fmessage-length", "237", "-pg", "-fgnuc-version=3D4.2.1", "-fobjc-runtime=3Dgnustep", "-fdiagnostics-show-option", "-fcolor-diagnostics", "-faddrsig", "-o", "/tmp/test-63e2c7.o", "-x", "c", "test.c" ],0x7fffffffebb0) EJUSTRETURN 891: execve("/usr/bin/ld",[ "/usr/bin/ld", "--eh-frame-hdr", "-dynamic-linker", "/libexec/ld-elf.so.1", "--hash-style=3Dboth", "--enable-new-dtags", "-o", "a.out", "/usr/lib/gcrt1.o", "/usr/lib/crti.o", "/usr/lib/crtbegin.o", "-L/usr/lib", "/tmp/test-63e2c7.o", "-lgcc_p", "-lgcc_eh_p", "-lc_p", "-lgcc_p", "-lgcc_eh_p", "/usr/lib/crtend.o", "/usr/lib/crtn.o" ],0x7fffffffebb0) EJUSTRETURN However, it's unclear to me, why it is passed in the first place, if clang = -pg wants to produce statically linked binary. There is apparently some inconsistency. --=20 You are receiving this mail because: You are the assignee for the bug.=
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?bug-250992-227-2HpP9TamP8>