Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Failure of darwin-segaddr.c on macOS 15 #138

Open
fxcoudert opened this issue Sep 24, 2024 · 1 comment
Open

Failure of darwin-segaddr.c on macOS 15 #138

fxcoudert opened this issue Sep 24, 2024 · 1 comment

Comments

@fxcoudert
Copy link
Contributor

I have not seen it on Intel, so it seems specific to ARM or this branch:

$ /Users/fx/ibin-20240923/gcc/xgcc -B/Users/fx/ibin-20240923/gcc/  /Users/fx/gcc-darwin-arm64/gcc/testsuite/gcc.dg/darwin-segaddr.c    -fdiagnostics-plain-output   -O0 -segaddr __TEST 0x110000000 -fno-pie  -lm  -o ./darwin-segaddr.exe -save-temps
ld: pointer not aligned in 'anon-1' (stubs-got-file)
collect2: error: ld returned 1 exit status

The generated assembly is:

$ cat darwin-segaddr.s
	.arch armv8.4-a+fp16+sb+ssbs
	.build_version macos,  15, 0
	.text
	.globl _t
	.section __TEST,__test
	.align	2
_t:
	.space 4
	.text
	.align	2
	.globl _main
_main:
LFB0:
	stp	x29, x30, [sp, -16]!
LCFI0:
	mov	x29, sp
LCFI1:
	adrp	x0, _t@PAGE
	add	x1, x0, _t@PAGEOFF;
	mov	x0, 268435456
	movk	x0, 0x1, lsl 32
	cmp	x1, x0
	beq	L2
	bl	_abort
L2:
	mov	w0, 0
	ldp	x29, x30, [sp], 16
LCFI2:
	ret
LFE0:
	.section __TEXT,__eh_frame,coalesced,no_toc+strip_static_syms+live_support
EH_frame1:
	.set L$set$0,LECIE1-LSCIE1
	.long L$set$0
LSCIE1:
	.long	0
	.byte	0x3
	.ascii "zR\0"
	.uleb128 0x1
	.sleb128 -8
	.uleb128 0x1e
	.uleb128 0x1
	.byte	0x10
	.byte	0xc
	.uleb128 0x1f
	.uleb128 0
	.align	3
LECIE1:
LSFDE1:
	.set L$set$1,LEFDE1-LASFDE1
	.long L$set$1
LASFDE1:
	.long	LASFDE1-EH_frame1
	.quad	LFB0-.
	.set L$set$2,LFE0-LFB0
	.quad L$set$2
	.uleb128 0
	.byte	0x4
	.set L$set$3,LCFI0-LFB0
	.long L$set$3
	.byte	0xe
	.uleb128 0x10
	.byte	0x9d
	.uleb128 0x2
	.byte	0x9e
	.uleb128 0x1
	.byte	0x4
	.set L$set$4,LCFI1-LCFI0
	.long L$set$4
	.byte	0xd
	.uleb128 0x1d
	.byte	0x4
	.set L$set$5,LCFI2-LCFI1
	.long L$set$5
	.byte	0xde
	.byte	0xdd
	.byte	0xc
	.uleb128 0x1f
	.uleb128 0
	.align	3
LEFDE1:
	.ident	"GCC: (GNU) 15.0.0 20240921 (experimental) [master-wip-apple-si a63cbc0336a]"
	.subsections_via_symbols
@iains
Copy link
Owner

iains commented Sep 24, 2024

Hmm .. this cannot work for Arm64 - since it relies on -fno-pie which is not honoured ... I would expect clang to reject it (and, if so, we should just skip this on arm64 - and probably on >= macOS11 where non-pie is deprecated on x86_64 as well)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants