From nobody Wed Jul 26 18:58:01 2023 X-Original-To: bugs@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4RB37Y4BNvz4pRfX for ; Wed, 26 Jul 2023 18:58:01 +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 "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4RB37Y128lz4H5D for ; Wed, 26 Jul 2023 18:58:01 +0000 (UTC) (envelope-from bugzilla-noreply@freebsd.org) ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1690397881; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=LKrh1BrIOD1gHq8lDiKRiMDTM9Dtxjv0GXGtpTihnhw=; b=PYB4gihqevpgJqcADdDvUFMJUcnKrNTRPwXvX7OOcbmvftNrtnU+9xUxGx9FvLdnSsIlOI of4QBPsPDlPUL3AllOSr+rVU0Tn/bQN9EWG8d/e85j+6TsqKo1zdHfOo01k6CDLKAwQwm+ 5rhPe8Dd/hMgiZ9c6ChPf6629SEvHlPCp4B8NXoIZTXEmMelcYw7/sR4fZh2Yg9eB0dphL 6OQ+4WTXXYYU6QiGmF08rBURx2Jai8WjeDf5Wij82AhCnhWeIoYQs3qyvsT3tF+jFnV1f+ Qvs5EGUe3374tfjJNvqwMtqSRPbQqU5+Vjq1lmgljALYqASxK8F0RLjz4TA92Q== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1690397881; a=rsa-sha256; cv=none; b=RdyqXHw4dkMw6vk4IKgzH9l7nAlp1ENpT5WobL0pLDEF76p9RSoimaRrqq0NsZ8bW0HH7k zqGGOLdWbvQOZ8/uL6DWdeUYP1AvswV9dBFLo0Xo37enpawJ0w98LSTXjvq4zD83BYN9Jh Qd2KnSMotZ8Ceg4hNlWE2fWuXxATsZrQsHD9eSWnGay96os8+vlz/Vl3z5MRY7mX/iZeX3 q356fUvqGG/TmiUu9XUcCsvQYpvfaog5rTMsDQBQch7cPJIwYoamg/4fq5CHzFA9W/ZbcN G8Jm/khjP5iD55ys6c7iEZKmNh8uQYrl9ZGUvZETbrDRlQcfwpCyxS/TayTXZg== 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 4RB37Y00dbztft for ; Wed, 26 Jul 2023 18:58:00 +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 36QIw0Ec049277 for ; Wed, 26 Jul 2023 18:58:00 GMT (envelope-from bugzilla-noreply@freebsd.org) Received: (from www@localhost) by kenobi.freebsd.org (8.15.2/8.15.2/Submit) id 36QIw09U049276 for bugs@FreeBSD.org; Wed, 26 Jul 2023 18:58:00 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 272740] CURRENT with ZFS not bootable when built with LLVM from ports Date: Wed, 26 Jul 2023 18:58:01 +0000 X-Bugzilla-Reason: AssignedTo X-Bugzilla-Type: new X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: Base System X-Bugzilla-Component: kern X-Bugzilla-Version: CURRENT X-Bugzilla-Keywords: X-Bugzilla-Severity: Affects Only Me X-Bugzilla-Who: bsd@orsolic.org X-Bugzilla-Status: New X-Bugzilla-Resolution: X-Bugzilla-Priority: --- X-Bugzilla-Assigned-To: bugs@FreeBSD.org X-Bugzilla-Flags: X-Bugzilla-Changed-Fields: bug_id short_desc product version rep_platform op_sys bug_status bug_severity priority component assigned_to reporter Message-ID: Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Bugzilla-URL: https://bugs.freebsd.org/bugzilla/ Auto-Submitted: auto-generated List-Id: Bug reports List-Archive: https://lists.freebsd.org/archives/freebsd-bugs List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-freebsd-bugs@freebsd.org MIME-Version: 1.0 X-Spam: Yes https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=3D272740 Bug ID: 272740 Summary: CURRENT with ZFS not bootable when built with LLVM from ports Product: Base System Version: CURRENT Hardware: amd64 OS: Any Status: New Severity: Affects Only Me Priority: --- Component: kern Assignee: bugs@FreeBSD.org Reporter: bsd@orsolic.org Building -CURRENT (2023-07-17 be4c7f273508) without system compiler (with LLVM16 from ports) results in unbootable system: Preloaded elf kernel "/boot/kernel/kernel" at 0xffffffff82328000. Preloaded elf obj module "/boot/kernel/zfs.ko" at 0xffffffff82329090. Preloaded boot_entropy_cache "/boot/entropy" at 0xffffffff823298f8. Preloaded elf obj module "/boot/kernel/cryptodev.ko" at 0xffffffff82329950. Preloaded hostuuid "/etc/hostid" at 0xffffffff8232a140. kldload: unexpected relocation type 42, symbol index 8662 link_elf_obj: symbol __stack_chk_guard undefined KLD file zfs.ko - could not finalize loading ... Trying to mount root from zfs:builder/ROOT/b4 []... Mounting from zfs:builder/ROOT/b4 failed with error 2: unknown file system. Loader variables: vfs.root.mountfrom=3Dzfs:builder/ROOT/b4 Manual root filesystem specification: : [options] Mount using filesystem and with the specified (optional) option list. eg. ufs:/dev/da0s1a zfs:zroot/ROOT/default cd9660:/dev/cd0 ro (which is equivalent to: mount -t cd9660 -o ro /dev/cd0 /) ? List valid disk boot devices . Yield 1 second (for background tasks) Abort manual input Patching and rebuilding LLVM16 with this patch results in bootable system: --- llvm/lib/CodeGen/TargetLoweringBase.cpp.orig 2023-06-11 00:58:16.000000000 +0200 +++ llvm/lib/CodeGen/TargetLoweringBase.cpp 2023-07-15 14:43:52.1519580= 00 +0200 @@ -1979,8 +1979,7 @@ // FreeBSD has "__stack_chk_guard" defined externally on libc.so if (TM.getRelocationModel() =3D=3D Reloc::Static && - !TM.getTargetTriple().isWindowsGNUEnvironment() && - !TM.getTargetTriple().isOSFreeBSD()) + !TM.getTargetTriple().isWindowsGNUEnvironment()) GV->setDSOLocal(true); } } Patch was taken from: https://cgit.freebsd.org/src/commit/?h=3Dstable/13&id=3De8e5d75e6a9676e76c3= bfd6d1d52561ffbb40846 Few months ago it was possible to use LLVM from ports to build kernel and world, but I don't remember the details. This patch was tested in bhyve VM and on real hardware. On real hardware it was possible to boot system without patched compiler wh= en zfs.ko (options ZFS and GEOM_ELI with devices crypto and cryptodev) is built into the kernel. But then other modules (acpi_ibm, iic, drm, i915kms, acpi_video, ... pf, various ng_* and so on) will fail to load with same reason. Didn't try including zfs.ko into the kernel in the VM. --=20 You are receiving this mail because: You are the assignee for the bug.=