Closed Bug 1720484 Opened 3 years ago Closed 1 year ago

Aarch64 cross build needs --without-sysroot to find the sysroot

Categories

(Firefox Build System :: Toolchains, defect)

Firefox 90
x86_64
Linux
defect

Tracking

(firefox118 fixed)

RESOLVED FIXED
118 Branch
Tracking Status
firefox118 --- fixed

People

(Reporter: ray-v, Assigned: glandium)

Details

Attachments

(2 files)

(In reply to Mike Hommey from comment #6)

With commit c1f943c83a23 included, and adding "--without-sysroot" to the build, libpulse is found => checking for libpulse... yes == the sysroot is found, and the build continues using the installed cross compiler toolchain, which seems a rather perverse situation.

Please file a new bug with more details about your build setup.

Rather than trying to second guess what information would be useful to you, I'll point you to my GitHub page.

I'm working on an update for mozilla 90.0 and removing SM relevant stuff and workarounds for anything less than v78, but for a basic FF build without localization or preferences as I've done for aarch64, it's still valid.

armv7 and i686 builds don't need --without-sysroot, and ignore it if it is added.

All builds were done to changeset 955ced16970f in mozilla-unified, aka beta 90.0b12, with patching for bug 1712804.

Your environment has SYSROOT set, which is equivalent to --with-sysroot=.... Adding --without-sysroot disables that and goes back to the previous behavior. On that part, that's not really a bug. That's an unfortunate consequence of your environment having SYSROOT set and exported.
Technically, the new setup should allow things to work without you having to set many of the things you set (like for pkgconfig).
Can you run the failing build with MOZ_CONFIGURE_TRACE=1 and attach the resulting config.log?

Flags: needinfo?(ray-v)
Attached file config.log.gz

Can you run the failing build with MOZ_CONFIGURE_TRACE=1 and attach the resulting config.log?

Attached.

Given your comments about SYSROOT and pkgconfig, you probably already know this, but I thought I'd confirm it. Running the pkg-config test in the shell environment is successful:

# /usr/bin/pkg-config --errors-to-stdout --print-errors libpulse;echo $?
0

Technically, the new setup should allow things to work without you having to set many of the things you set (like for pkgconfig).

I think that's the clue to the problem and solution. In Slackware, 64-bit systems use lib64 for the library directories. With this patch, libpulse is found and the build continues with or without --without-sysroot.

--- build/moz.configure/pkg.configure
+++ build/moz.configure/pkg.configure
@@ -28,6 +28,7 @@
             PKG_CONFIG_LIBDIR=":".join(
                 os.path.join(sysroot_path, d)
                 for d in (
+                    "usr/lib64/pkgconfig",
                     "usr/lib/pkgconfig",
                     "usr/lib/{}/pkgconfig".format(multiarch_dir),
                     "usr/share/pkgconfig",

Which also explains why the armv7 and i686 32-bit builds weren't affected.

Flags: needinfo?(ray-v)

Does it still work if you remove usr/lib/pkgconfig?

Flags: needinfo?(ray-v)

Does it still work if you remove usr/lib/pkgconfig?

Yes.

build/moz.configure/pkg.configure:

28:            PKG_CONFIG_LIBDIR=":".join(
29-                os.path.join(sysroot_path, d)
30-                for d in (
31-                    "usr/lib64/pkgconfig",
32-                    "usr/lib/{}/pkgconfig".format(multiarch_dir),
33-                    "usr/share/pkgconfig",
34-                )

With --without-sysroot:

 0:02.35   --target=aarch64-unknown-linux-gnu
 0:02.35   --without-sysroot
 0:02.35   --enable-application=browser
....
 0:08.37 checking for libpulse... yes

Without --without-sysroot:

 0:02.37   --target=aarch64-unknown-linux-gnu
 0:02.37   --enable-application=browser
....
 0:08.11 checking for libpulse... yes
Flags: needinfo?(ray-v)
Assignee: nobody → mh+mozilla
Status: UNCONFIRMED → ASSIGNED
Ever confirmed: true
Pushed by mh@glandium.org: https://hg.mozilla.org/integration/autoland/rev/49a55aa6d804 Add /usr/lib64/pkgconfig to the list of pkg-config directories we try in sysroots. r=firefox-build-system-reviewers,ahochheiden
Status: ASSIGNED → RESOLVED
Closed: 1 year ago
Resolution: --- → FIXED
Target Milestone: --- → 118 Branch
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Creator:
Created:
Updated:
Size: