Skip to content

Commit

Permalink
cross: move multilib options to [binaries] section
Browse files Browse the repository at this point in the history
c_args are meant to be overridden by the user if needed (even via the
environment CFLAGS variables + -Doptimization=plain, for example),
so they should not contain any option that affect the multilib search
path.  For example, a hypothetical native file like this:

   [binaries]
   c = gcc

   [built-in options]
   c_args = ['-m32']

would *not* build 32-bit binaries if -Dc_args is passed to meson.
Such options, instead should be in the [binaries] section.  Adjust
the sample cross files included with meson.

Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
  • Loading branch information
bonzini authored and eli-schwartz committed Jan 11, 2023
1 parent e96929f commit cf23e34
Show file tree
Hide file tree
Showing 6 changed files with 25 additions and 28 deletions.
5 changes: 1 addition & 4 deletions cross/armclang-linux.txt
Original file line number Diff line number Diff line change
Expand Up @@ -17,16 +17,13 @@
[binaries]
# we could set exe_wrapper = qemu-arm-static but to test the case
# when cross compiled binaries can't be run we don't do that
c = '/opt/arm/developmentstudio-2019.0/sw/ARMCompiler6.12/bin/armclang'
c = ['/opt/arm/developmentstudio-2019.0/sw/ARMCompiler6.12/bin/armclang', '--target=aarch64-arm-none-eabi']
#c = '/opt/arm/developmentstudio-2019.0/sw/ARMCompiler5.06u6/bin/armcc'
#cpp = '/usr/bin/arm-linux-gnueabihf-g++'
ar = '/opt/arm/developmentstudio-2019.0/sw/ARMCompiler6.12/bin/armar'
#strip = '/usr/arm-linux-gnueabihf/bin/strip'
#pkgconfig = '/usr/bin/arm-linux-gnueabihf-pkg-config'

[built-in options]
c_args = ['--target=aarch64-arm-none-eabi']

[host_machine]
system = 'baremetal'
cpu_family = 'arm'
Expand Down
8 changes: 4 additions & 4 deletions cross/armclang.txt
Original file line number Diff line number Diff line change
Expand Up @@ -2,16 +2,16 @@
# to the environment(PATH) variable, so that Meson can find
# the armclang, armlink and armar while building.
[binaries]
c = 'armclang'
cpp = 'armclang'
c = ['armclang', '--target=arm-arm-none-eabi']
cpp = ['armclang', '--target=arm-arm-none-eabi']
ar = 'armar'
strip = 'armar'

[built-in options]
# The '--target', '-mcpu' options with the appropriate values should be mentioned
# to cross compile c/c++ code with armclang.
c_args = ['--target=arm-arm-none-eabi', '-mcpu=cortex-m0plus']
cpp_args = ['--target=arm-arm-none-eabi', '-mcpu=cortex-m0plus']
c_args = ['-mcpu=cortex-m0plus']
cpp_args = ['-mcpu=cortex-m0plus']

[host_machine]
system = 'bare metal' # Update with your system name - bare metal/OS.
Expand Down
4 changes: 2 additions & 2 deletions cross/ccomp-armv7a.txt
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
[binaries]
c = 'ccomp'
c = ['ccomp', '-target', 'armv7a-eabi']
ar = 'ccomp'
strip = 'strip'

[built-in options]
c_args = ['-target', 'armv7a-eabi', '-fall']
c_args = ['-fall']

[host_machine]
system = 'bare metal' # Update with your system name - bare metal/OS.
Expand Down
20 changes: 10 additions & 10 deletions cross/iphone.txt
Original file line number Diff line number Diff line change
Expand Up @@ -3,20 +3,20 @@
# these might not work for you. Use the googels and xcrun.

[binaries]
c = 'clang'
cpp = 'clang++'
objc = 'clang'
objcpp = 'clang++'
c = ['clang', '-arch', 'arm64', '-isysroot', '/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS.sdk']
cpp = ['clang++', '-arch', 'arm64', '-isysroot', '/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS.sdk']
objc = ['clang', '-arch', 'arm64', '-isysroot', '/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS.sdk']
objcpp = ['clang++', '-arch', 'arm64', '-isysroot', '/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS.sdk']
ar = 'ar'
strip = 'strip'

[built-in options]
c_args = ['-arch', 'arm64', '-miphoneos-version-min=11.0', '-isysroot', '/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS.sdk']
cpp_args = ['-arch', 'arm64', '-miphoneos-version-min=11.0', '-isysroot', '/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS.sdk']
c_link_args = ['-arch', 'arm64', '-miphoneos-version-min=11.0', '-isysroot', '/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS.sdk']
cpp_link_args = ['-arch', 'arm64', '-miphoneos-version-min=11.0', '-isysroot', '/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS.sdk']
objc_args = ['-arch', 'arm64', '-miphoneos-version-min=11.0', '-isysroot', '/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS.sdk']
objcpp_args = ['-arch', 'arm64', '-miphoneos-version-min=11.0', '-isysroot', '/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS.sdk']
c_args = ['-miphoneos-version-min=11.0']
cpp_args = ['-miphoneos-version-min=11.0']
c_link_args = ['-miphoneos-version-min=11.0']
cpp_link_args = ['-miphoneos-version-min=11.0']
objc_args = ['-miphoneos-version-min=11.0']
objcpp_args = ['-miphoneos-version-min=11.0']

[properties]
root = '/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer'
Expand Down
12 changes: 6 additions & 6 deletions cross/tvos.txt
Original file line number Diff line number Diff line change
Expand Up @@ -3,16 +3,16 @@
# these might not work for you. Use the googels and xcrun.

[binaries]
c = 'clang'
cpp = 'clang++'
c = ['clang', '-arch', 'arm64', '-isysroot', '/Applications/Xcode.app/Contents/Developer/Platforms/AppleTVOS.platform/Developer/SDKs/AppleTVOS.sdk']
cpp = ['clang++', '-arch', 'arm64', '-isysroot', '/Applications/Xcode.app/Contents/Developer/Platforms/AppleTVOS.platform/Developer/SDKs/AppleTVOS.sdk']
ar = 'ar'
strip = 'strip'

[built-in options]
c_args = ['-arch', 'arm64', '-mtvos-version-min=12.0', '-isysroot', '/Applications/Xcode.app/Contents/Developer/Platforms/AppleTVOS.platform/Developer/SDKs/AppleTVOS.sdk']
cpp_args = ['-arch', 'arm64', '-mtvos-version-min=12.0', '-isysroot', '/Applications/Xcode.app/Contents/Developer/Platforms/AppleTVOS.platform/Developer/SDKs/AppleTVOS.sdk']
c_link_args = ['-arch', 'arm64', '-mtvos-version-min=12.0', '-isysroot', '/Applications/Xcode.app/Contents/Developer/Platforms/AppleTVOS.platform/Developer/SDKs/AppleTVOS.sdk']
cpp_link_args = ['-arch', 'arm64', '-mtvos-version-min=12.0', '-isysroot', '/Applications/Xcode.app/Contents/Developer/Platforms/AppleTVOS.platform/Developer/SDKs/AppleTVOS.sdk']
c_args = ['-mtvos-version-min=12.0']
cpp_args = ['-mtvos-version-min=12.0']
c_link_args = ['-mtvos-version-min=12.0']
cpp_link_args = ['-mtvos-version-min=12.0']

[properties]
root = '/Applications/Xcode.app/Contents/Developer/Platforms/AppleTVOS.platform/Developer'
Expand Down
4 changes: 2 additions & 2 deletions cross/ubuntu-armhf.txt
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
[binaries]
# we could set exe_wrapper = qemu-arm-static but to test the case
# when cross compiled binaries can't be run we don't do that
c = '/usr/bin/arm-linux-gnueabihf-gcc'
cpp = '/usr/bin/arm-linux-gnueabihf-g++'
c = ['/usr/bin/arm-linux-gnueabihf-gcc', '--target', 'arm-unknown-linux-gnueabihf']
cpp = ['/usr/bin/arm-linux-gnueabihf-g++', '--target', 'arm-unknown-linux-gnueabihf']
rust = ['rustc', '--target', 'arm-unknown-linux-gnueabihf', '-C', 'linker=/usr/bin/arm-linux-gnueabihf-gcc-7']
ar = '/usr/arm-linux-gnueabihf/bin/ar'
strip = '/usr/arm-linux-gnueabihf/bin/strip'
Expand Down

0 comments on commit cf23e34

Please sign in to comment.