From owner-freebsd-bugs@freebsd.org Mon Nov 9 22:18:57 2020 Return-Path: Delivered-To: freebsd-bugs@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 4AD9E46ED14 for ; Mon, 9 Nov 2020 22:18:57 +0000 (UTC) (envelope-from bugzilla-noreply@freebsd.org) Received: from mailman.nyi.freebsd.org (unknown [127.0.1.3]) by mx1.freebsd.org (Postfix) with ESMTP id 4CVQPs1QGpz4Rh2 for ; Mon, 9 Nov 2020 22:18:57 +0000 (UTC) (envelope-from bugzilla-noreply@freebsd.org) Received: by mailman.nyi.freebsd.org (Postfix) id 2EB7C46EE0E; Mon, 9 Nov 2020 22:18:57 +0000 (UTC) Delivered-To: bugs@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 2E7A646EB27 for ; Mon, 9 Nov 2020 22:18:57 +0000 (UTC) (envelope-from bugzilla-noreply@freebsd.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4CVQPs0jKRz4RkN for ; Mon, 9 Nov 2020 22:18:57 +0000 (UTC) (envelope-from bugzilla-noreply@freebsd.org) Received: from kenobi.freebsd.org (kenobi.freebsd.org [IPv6:2610:1c1:1:606c::50:1d]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 072F018621 for ; Mon, 9 Nov 2020 22:18:57 +0000 (UTC) (envelope-from bugzilla-noreply@freebsd.org) Received: from kenobi.freebsd.org ([127.0.1.5]) by kenobi.freebsd.org (8.15.2/8.15.2) with ESMTP id 0A9MIuS0046706 for ; Mon, 9 Nov 2020 22:18:56 GMT (envelope-from bugzilla-noreply@freebsd.org) Received: (from www@localhost) by kenobi.freebsd.org (8.15.2/8.15.2/Submit) id 0A9MIuRZ046705 for bugs@FreeBSD.org; Mon, 9 Nov 2020 22:18:56 GMT (envelope-from bugzilla-noreply@freebsd.org) X-Authentication-Warning: kenobi.freebsd.org: www set sender to bugzilla-noreply@freebsd.org using -f 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 Date: Mon, 09 Nov 2020 22:18:57 +0000 X-Bugzilla-Reason: AssignedTo X-Bugzilla-Type: changed X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: Base System X-Bugzilla-Component: bin X-Bugzilla-Version: 12.2-RELEASE X-Bugzilla-Keywords: X-Bugzilla-Severity: Affects Only Me X-Bugzilla-Who: oleg.derevenetz@gmail.com X-Bugzilla-Status: New X-Bugzilla-Resolution: X-Bugzilla-Priority: --- X-Bugzilla-Assigned-To: bugs@FreeBSD.org X-Bugzilla-Flags: X-Bugzilla-Changed-Fields: Message-ID: In-Reply-To: References: Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Bugzilla-URL: https://bugs.freebsd.org/bugzilla/ Auto-Submitted: auto-generated MIME-Version: 1.0 X-BeenThere: freebsd-bugs@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Bug reports List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 09 Nov 2020 22:18:57 -0000 https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=3D250992 --- Comment #2 from Oleg Derevenetz --- 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.=