You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@openoffice.apache.org by pf...@apache.org on 2026/10/21 15:54:50 UTC
(openoffice) 02/02: freebsd_aarch64: Add build environment wiring for FreeBSD AArch64 - Add FreeBSD AArch64 / ARM64 platform detection in set_soenv.in (CPU=A, CPUNAME=AARCH64, OUTPATH=unxfbsda). - Fix Perl precedence warning (! =~ 'gcc') at set_soenv.in line 1494. - Source FreeBSDAARCH64Env.Set.sh in source_soenv.sh. - Add unxfbsda.mk and include it from unxfbsd.mk when CPUNAME is AARCH64. - Normalize CPU=A to CPUNAME=AARCH64 and enable -fstack-protector in freebsd.mk. - Add unxfbsda to installer download. [...]
This is an automated email from the ASF dual-hosted git repository.
asf-gitbox-commits pushed a commit to branch trunk
in repository https://gitbox.apache.org/repos/asf/openoffice.git
commit 7d4ffaae88c98c478a1cd40f4f99897a70f33ba7
Author: Pedro Giffuni <pf...@apache.org>
AuthorDate: Wed Oct 21 10:53:30 2026 -0500
freebsd_aarch64: Add build environment wiring for FreeBSD AArch64
- Add FreeBSD AArch64 / ARM64 platform detection in set_soenv.in
(CPU=A, CPUNAME=AARCH64, OUTPATH=unxfbsda).
- Fix Perl precedence warning (! =~ 'gcc') at set_soenv.in line 1494.
- Source FreeBSDAARCH64Env.Set.sh in source_soenv.sh.
- Add unxfbsda.mk and include it from unxfbsd.mk when CPUNAME is AARCH64.
- Normalize CPU=A to CPUNAME=AARCH64 and enable -fstack-protector in freebsd.mk.
- Add unxfbsda to installer download.pm and update_module_ignore_lists.pl.
- Avoid false match on 32-bit ARM_TARGET check in configure.ac.
---
main/configure.ac | 2 +-
main/set_soenv.in | 13 +++++++-
main/solenv/bin/modules/installer/download.pm | 6 ++--
main/solenv/bin/update_module_ignore_lists.pl | 1 +
main/solenv/gbuild/platform/freebsd.mk | 6 +++-
main/solenv/inc/unxfbsd.mk | 3 ++
main/solenv/inc/unxfbsda.mk | 45 +++++++++++++++++++++++++++
main/source_soenv.sh | 3 ++
8 files changed, 74 insertions(+), 5 deletions(-)
diff --git a/main/configure.ac b/main/configure.ac
index 227feb2c89..6481e672fb 100644
--- a/main/configure.ac
+++ b/main/configure.ac
@@ -6819,7 +6819,7 @@ dnl ===================================================================
dnl Check the ARM target
dnl ===================================================================
-if echo "$build_cpu" | $GREP -q arm; then
+if echo "$build_cpu" | $GREP -q arm && test "$build_cpu" != "arm64" && test "$build_cpu" != "aarch64"; then
# default value
ARM_TARGET=ARMV4T
AC_MSG_CHECKING([which ARM processor optimization to use])
diff --git a/main/set_soenv.in b/main/set_soenv.in
index a12b61ce37..9d17b2a278 100644
--- a/main/set_soenv.in
+++ b/main/set_soenv.in
@@ -383,6 +383,17 @@ elsif ( $platform =~ m/freebsd/ )
$JRETHREADDIR = '$JAVA_HOME'.$ds."jre".$ds."lib".$ds."amd64".$ds."native_threads";
}
}
+ elsif (($platform =~ m/^aarch64/) || ($platform =~ m/^arm64/))
+ { print "Setting FreeBSD AArch64 specific values... ";
+ $outfile = "FreeBSDAARCH64Env.Set";
+ $CPU = "A";
+ $CPUNAME = "AARCH64";
+ $OUTPATH = "unxfbsda";
+ $JRELIBDIR = '$JAVA_HOME'.$ds."jre".$ds."lib".$ds."aarch64";
+ $JRETOOLKITDIR = '$JAVA_HOME'.$ds."jre".$ds."lib".$ds."aarch64".$ds."server";
+ $JRETHREADDIR = '$JAVA_HOME'.$ds."jre".$ds."lib".$ds."aarch64".$ds."native_threads";
+ $EPM_FLAGS = "-a aarch64";
+ }
elsif ($platform =~ m/^i386/)
{ print "Setting FreeBSD x86 specific values... ";
$outfile = "FreeBSDX86Env.Set";
@@ -1490,7 +1501,7 @@ if ($platform =~ m/linux|freebsd|netbsd/)
{
# This simply adds an include path, so even cases that break the FHS work
}
-if ($platform =~ m/solaris/ && ! $CC =~ "gcc")
+if ($platform =~ m/solaris/ && $CC !~ "gcc")
{
$SOLARINC .= '/SC5 ';
}
diff --git a/main/solenv/bin/modules/installer/download.pm b/main/solenv/bin/modules/installer/download.pm
index 4c97588c87..394dbcd5d2 100644
--- a/main/solenv/bin/modules/installer/download.pm
+++ b/main/solenv/bin/modules/installer/download.pm
@@ -611,11 +611,13 @@ sub get_download_architecture
$arch = "x64";
}
elsif(( $installer::globals::compiler =~ /^unxlngx/ )
- || ( $installer::globals::compiler =~ /^unxmaccx/ ))
+ || ( $installer::globals::compiler =~ /^unxmaccx/ )
+ || ( $installer::globals::compiler =~ /^unxfbsdx/ ))
{
$arch = "x86-64";
}
- elsif ( $installer::globals::compiler =~ /^unxmaccr/ )
+ elsif(( $installer::globals::compiler =~ /^unxmaccr/ )
+ || ( $installer::globals::compiler =~ /^unxfbsda/ ))
{
$arch = "aarch64";
}
diff --git a/main/solenv/bin/update_module_ignore_lists.pl b/main/solenv/bin/update_module_ignore_lists.pl
index f7eecef05d..fb6c135ecb 100644
--- a/main/solenv/bin/update_module_ignore_lists.pl
+++ b/main/solenv/bin/update_module_ignore_lists.pl
@@ -57,6 +57,7 @@ my @platforms = (
"unxfbsdi",
"unxfbsd",
"unxfbsdx",
+ "unxfbsda",
"unxhpgr",
"unxhpxr",
"unxirgm",
diff --git a/main/solenv/gbuild/platform/freebsd.mk b/main/solenv/gbuild/platform/freebsd.mk
index 21869f33fb..dfb19bd51f 100644
--- a/main/solenv/gbuild/platform/freebsd.mk
+++ b/main/solenv/gbuild/platform/freebsd.mk
@@ -40,6 +40,10 @@ ifeq ($(CPU),P)
CPUNAME := POWERPC64
endif
+ifeq ($(CPU),A)
+CPUNAME := AARCH64
+endif
+
# use CC/CXX if they are nondefaults
ifneq ($(origin CC),default)
gb_CC := $(CC)
@@ -151,7 +155,7 @@ gb_LinkTarget_LDFLAGS += \
endif
-ifneq ($(filter $(CPUNAME),INTEL X86_64),)
+ifneq ($(filter $(CPUNAME),INTEL X86_64 AARCH64),)
gb_CFLAGS += -fstack-protector
gb_CXXFLAGS += -fstack-protector
gb_LinkTarget_LDFLAGS += -fstack-protector
diff --git a/main/solenv/inc/unxfbsd.mk b/main/solenv/inc/unxfbsd.mk
index 4ab61ba8d9..f5fe4c13fc 100644
--- a/main/solenv/inc/unxfbsd.mk
+++ b/main/solenv/inc/unxfbsd.mk
@@ -46,6 +46,9 @@ JAVAFLAGSDEBUG=-g
.IF "$(CPUNAME)" == "ARM"
.INCLUDE : unxfbsdr.mk
.ENDIF
+.IF "$(CPUNAME)" == "AARCH64"
+.INCLUDE : unxfbsda.mk
+.ENDIF
# filter for suppressing verbose messages from linker
#not needed at the moment
diff --git a/main/solenv/inc/unxfbsda.mk b/main/solenv/inc/unxfbsda.mk
new file mode 100644
index 0000000000..213f03094c
--- /dev/null
+++ b/main/solenv/inc/unxfbsda.mk
@@ -0,0 +1,45 @@
+#**************************************************************
+#
+# Licensed to the Apache Software Foundation (ASF) under one
+# or more contributor license agreements. See the NOTICE file
+# distributed with this work for additional information
+# regarding copyright ownership. The ASF licenses this file
+# to you under the Apache License, Version 2.0 (the
+# "License"); you may not use this file except in compliance
+# with the License. You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing,
+# software distributed under the License is distributed on an
+# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+# KIND, either express or implied. See the License for the
+# specific language governing permissions and limitations
+# under the License.
+#
+#**************************************************************
+
+
+
+#
+# FreeBSD/aarch64 specific defines
+#
+
+CDEFS+=-DAARCH64
+
+# architecture dependent flags for the C and C++ compiler that can be changed by
+# exporting the variable ARCH_FLAGS="..." in the shell, which is used to start build
+.IF "$(CPUNAME)" == "AARCH64"
+ARCH_FLAGS*=
+.ENDIF
+
+# Compiler flags for enabling optimizations
+.IF "$(PRODUCT)"!=""
+CFLAGSOPT=-O2 -fno-strict-aliasing # optimizing for products
+.ELSE # "$(PRODUCT)"!=""
+CFLAGSOPT= # no optimizing for non products
+.ENDIF # "$(PRODUCT)"!=""
+
+# platform specific identifier for shared libs
+DLLPOSTFIX=
+BUILD64=1
diff --git a/main/source_soenv.sh b/main/source_soenv.sh
index ce87621c36..e460e8a99f 100644
--- a/main/source_soenv.sh
+++ b/main/source_soenv.sh
@@ -95,6 +95,9 @@ else
amd64-*-freebsd*|x86_64-*-freebsd*)
. ./FreeBSDAMDEnv.Set.sh
;;
+ aarch64-*-freebsd*|arm64-*-freebsd*)
+ . ./FreeBSDAARCH64Env.Set.sh
+ ;;
arm*-*-freebsd*)
. ./FreeBSDARMEnv.Set.sh
;;