summaryrefslogtreecommitdiffstats
path: root/build/macosx
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-07 09:22:09 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-07 09:22:09 +0000
commit43a97878ce14b72f0981164f87f2e35e14151312 (patch)
tree620249daf56c0258faa40cbdcf9cfba06de2a846 /build/macosx
parentInitial commit. (diff)
downloadfirefox-upstream.tar.xz
firefox-upstream.zip
Adding upstream version 110.0.1.upstream/110.0.1upstream
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'build/macosx')
-rw-r--r--build/macosx/cross-mozconfig.common33
-rw-r--r--build/macosx/mozconfig.common13
-rw-r--r--build/macosx/permissions/chown_revert.c18
-rw-r--r--build/macosx/permissions/chown_root.c12
4 files changed, 76 insertions, 0 deletions
diff --git a/build/macosx/cross-mozconfig.common b/build/macosx/cross-mozconfig.common
new file mode 100644
index 0000000000..982bb81ee6
--- /dev/null
+++ b/build/macosx/cross-mozconfig.common
@@ -0,0 +1,33 @@
+# This Source Code Form is subject to the terms of the Mozilla Public
+# License, v. 2.0. If a copy of the MPL was not distributed with this
+# file, You can obtain one at http://mozilla.org/MPL/2.0/.
+
+. "$topsrcdir/build/mozconfig.common"
+
+# cctools for ld, ar, and other related tools ; dsymutil for rust.
+mk_add_options "export PATH=$MOZ_FETCHES_DIR/cctools/bin:$MOZ_FETCHES_DIR/binutils/bin:$MOZ_FETCHES_DIR/clang/bin:$PATH"
+
+# dsymutil needs a libstdc++ more recent than what's on the system.
+mk_add_options "export LD_LIBRARY_PATH=$MOZ_FETCHES_DIR/clang/lib"
+
+export CFLAGS="$CFLAGS -fcrash-diagnostics-dir=${UPLOAD_PATH}"
+export CXXFLAGS="$CXXFLAGS -fcrash-diagnostics-dir=${UPLOAD_PATH}"
+export DSYMUTIL=$MOZ_FETCHES_DIR/clang/bin/dsymutil
+export MKFSHFS=$MOZ_FETCHES_DIR/hfsplus/newfs_hfs
+export DMG_TOOL=$MOZ_FETCHES_DIR/dmg/dmg
+export HFS_TOOL=$MOZ_FETCHES_DIR/dmg/hfsplus
+
+export HOST_CFLAGS="-g"
+export HOST_CXXFLAGS="-g"
+export HOST_LDFLAGS="-g"
+
+ac_add_options --target=x86_64-apple-darwin
+
+if [ "x$MOZ_PKG_SPECIAL" != "xasan" -a -z "$MOZ_AUTOMATION_ARTIFACT_BUILDS" ]; then
+ # Enable static analysis checks by default on OSX cross builds.
+ # Exception is ASan, where this breaks.
+ # The option is not valid on artifact builds, so don't add it there either.
+ ac_add_options --enable-clang-plugin
+fi
+
+unset MOZ_STDCXX_COMPAT
diff --git a/build/macosx/mozconfig.common b/build/macosx/mozconfig.common
new file mode 100644
index 0000000000..90539a04a1
--- /dev/null
+++ b/build/macosx/mozconfig.common
@@ -0,0 +1,13 @@
+if test `uname -s` = Linux; then
+ . $topsrcdir/build/macosx/cross-mozconfig.common
+fi
+
+export MACOS_SDK_DIR=$MOZ_FETCHES_DIR/MacOSX11.3.sdk
+
+if [ -n "$TASKCLUSTER_PGO_PROFILE_USE" -a -z "$USE_ARTIFACT" ]; then
+ # Work around https://github.com/llvm/llvm-project/issues/57734
+ export LDFLAGS=-Wl,-mllvm,--opaque-pointers
+
+ # Keep using ld64 on PGO/LTO builds because of performance regressions when using lld.
+ ac_add_options --enable-linker=ld64
+fi
diff --git a/build/macosx/permissions/chown_revert.c b/build/macosx/permissions/chown_revert.c
new file mode 100644
index 0000000000..72dc1e64d5
--- /dev/null
+++ b/build/macosx/permissions/chown_revert.c
@@ -0,0 +1,18 @@
+/* This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
+
+#include <unistd.h>
+#include <stdio.h>
+
+int main(int argc, char** argv) {
+ if (argc != 2) return 1;
+
+ uid_t realuser = getuid();
+ char uidstring[20];
+ snprintf(uidstring, 19, "%i", realuser);
+ uidstring[19] = '\0';
+
+ return execl("/usr/sbin/chown", "/usr/sbin/chown", "-R", "-h", uidstring,
+ argv[1], (char*)0);
+}
diff --git a/build/macosx/permissions/chown_root.c b/build/macosx/permissions/chown_root.c
new file mode 100644
index 0000000000..e2ef111c7f
--- /dev/null
+++ b/build/macosx/permissions/chown_root.c
@@ -0,0 +1,12 @@
+/* This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
+
+#include <unistd.h>
+
+int main(int argc, char** argv) {
+ if (argc != 2) return 1;
+
+ return execl("/usr/sbin/chown", "/usr/sbin/chown", "-R", "-h", "root:admin",
+ argv[1], (char*)0);
+}