Skip to content

Commit

Permalink
i#7334: Set package name for on-arm builds (#7335)
Browse files Browse the repository at this point in the history
Today the package platform name assumes x86 and is overridden for
cross-compile jobs only in package.cmake. So a package build on an arm
machine has an x86 name like
'DynamoRIO-x86_64-Linux-11.90.20152.tar.gz".

We fix that here to support building packages on arm machines directly.
Tested on an aarch64 machine where this fix produces the name
"DynamoRIO-AArch64-Linux-11.90.20152.tar.gz".

Fixes #7334
  • Loading branch information
derekbruening authored Mar 7, 2025
1 parent 111b344 commit 6d04dd1
Showing 1 changed file with 27 additions and 12 deletions.
39 changes: 27 additions & 12 deletions suite/runsuite_common_pre.cmake
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# **********************************************************
# Copyright (c) 2011-2023 Google, Inc. All rights reserved.
# Copyright (c) 2011-2025 Google, Inc. All rights reserved.
# Copyright (c) 2009-2010 VMware, Inc. All rights reserved.
# **********************************************************

Expand Down Expand Up @@ -277,17 +277,6 @@ if (arg_ssh)
GENERATE_PDBS:BOOL=OFF")
endif (arg_ssh)

# Make it clear that single-bitwidth packages only contain that bitwidth
# (and provide unique names for CI deployment).
if (NOT "${base_cache}" MATCHES "PACKAGE_PLATFORM")
if (arg_64_only)
set(base_cache "${base_cache}
PACKAGE_PLATFORM:STRING=x86_64-")
elseif (arg_32_only)
set(base_cache "${base_cache}
PACKAGE_PLATFORM:STRING=i386-")
endif ()
endif ()
if (arg_use_make)
find_program(MAKE_COMMAND make DOC "make command")
if (NOT MAKE_COMMAND)
Expand Down Expand Up @@ -458,6 +447,32 @@ if (NOT KERNEL_IS_X64)
message("WARNING: Kernel is not x64, skipping x64 builds")
endif ()

# Make it clear that single-bitwidth packages only contain that bitwidth
# (and provide unique names for CI deployment).
# Also set aarchxx names when not doing cross-compilation which sets
# them ahead of time.
if (NOT "${base_cache}" MATCHES "PACKAGE_PLATFORM:STRING=[A-Za-z]" AND
NOT "${base_cache}" MATCHES "PACKAGE_PLATFORM=[A-Za-z]")
if (arg_64_only)
if ("${machine}" MATCHES "aarch64|arm64")
set(base_cache "${base_cache}
PACKAGE_PLATFORM:STRING=AArch64-")
else ()
set(base_cache "${base_cache}
PACKAGE_PLATFORM:STRING=x86_64-")
endif ()
elseif (arg_32_only)
if ("${machine}" MATCHES "aarch32|arm")
set(base_cache "${base_cache}
PACKAGE_PLATFORM:STRING=ARM-
PACKAGE_SUBSYS:STRING=-EABIHF")
else ()
set(base_cache "${base_cache}
PACKAGE_PLATFORM:STRING=i386-")
endif ()
endif ()
endif ()

if (arg_use_ninja)
set(CTEST_CMAKE_GENERATOR "Ninja")
elseif (arg_use_make)
Expand Down

0 comments on commit 6d04dd1

Please sign in to comment.