nasm: Use different test sources for x86 and x86_64

The x86 test files might not work on x86_64 Linux in certain cases,
for example if the kernel is configured without support for x86
executables (which also gets rid of the old system call interface).

Bug: https://bugs.gentoo.org/936911
pull/12255/head
Kacper Słomiński 2 months ago committed by Eli Schwartz
parent d3f28217c5
commit 9501228168
  1. 0
      test cases/nasm/1 configure file/hello-x86.asm
  2. 18
      test cases/nasm/1 configure file/hello-x86_64.asm
  3. 2
      test cases/nasm/1 configure file/meson.build
  4. 0
      test cases/nasm/2 asm language/hello-x86.asm
  5. 22
      test cases/nasm/2 asm language/hello-x86_64.asm
  6. 4
      test cases/nasm/2 asm language/meson.build

@ -0,0 +1,18 @@
%include "config.asm"
section .data
msg: db "Hello World", 10
len: equ $ - msg
section .text
global main
main:
mov eax, 1 ; sys_write
mov edi, 1 ; fd = STDOUT_FILENO
mov rsi, msg ; buf = msg
mov rdx, len ; count = len
syscall
mov eax, 60 ; sys_exit
mov edi, HELLO ; exit code
syscall

@ -50,7 +50,7 @@ config_file = configure_file(
cc = meson.get_compiler('c')
link_args = cc.get_supported_link_arguments(['-no-pie'])
exe = executable('hello', asm_gen.process('hello.asm'),
exe = executable('hello', asm_gen.process('hello-' + host_machine.cpu_family() + '.asm'),
link_args: link_args,
)

@ -0,0 +1,22 @@
%include "config.asm"
%ifdef FOO
%define RETVAL HELLO
%endif
section .data
msg: db "Hello World", 10
len: equ $ - msg
section .text
global main
main:
mov eax, 1 ; sys_write
mov edi, 1 ; fd = STDOUT_FILENO
mov rsi, msg ; buf = msg
mov rdx, len ; count = len
syscall
mov eax, 60 ; sys_exit
mov edi, RETVAL ; exit code
syscall

@ -46,7 +46,7 @@ config_file = configure_file(
cc = meson.get_compiler('c')
link_args = cc.get_supported_link_arguments(['-no-pie'])
exe = executable('hello', 'hello.asm',
exe = executable('hello', 'hello-' + host_machine.cpu_family() + '.asm',
nasm_args: '-DFOO',
link_args: link_args,
)
@ -55,7 +55,7 @@ test('hello', exe)
#Test whether pthread dependency gets filtered out
threads = dependency('threads')
exe2 = executable('hello_w_threads', 'hello.asm',
exe2 = executable('hello_w_threads', 'hello-' + host_machine.cpu_family() + '.asm',
config_file,
nasm_args: '-DFOO',
link_args: link_args,

Loading…
Cancel
Save