Follow @Openwall on Twitter for new release announcements and other news
[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-ID: <20150309185058.GL16260@port70.net>
Date: Mon, 9 Mar 2015 19:50:58 +0100
From: Szabolcs Nagy <nsz@...t70.net>
To: musl@...ts.openwall.com
Subject: aarch64 port

attached patch adds aarch64 support

tested on foundation model + linaro rootfs, there are some issues still:

dynlink
	should work, relocs lisghtly tested, but vdso does not work
	yet (at least i see clock_gettime syscalls in strace)
__syscall_cp_asm
	i used "cbnz w0,__cancel", that is "compare and branch on nonzero"
	but it has a +-1M limit on the jump is that ok?
__tlsdesc_dynamic
	needs to access dtv for which the asm needs sizeof(struct pthread)
	so we may want to add the dtv at the end of pthread struct too
syscall.h
	is aarch64 only syscalls ok here or do we want a generic
	32bit+64bit syscall header like kernel has now for new archs?
socket.h
	needs __BYTE_ORDER workarounds, not tested on bigendian
	i think i need to include endian.h somewhere i think this should be ok
	but not tested on bigendian
ioctl.h
	may needs some further checks
	i removed TCGETS2,etc which used struct termios2
atomic.h
	a_crash probably should be a single instruction
	a_spin is probably fine but pthread_spin* could be improved
signal.h, user.h
	exposes ucontext stuff which uses __attribute__((aligned(16))) (can be
	fixed with manual padding i guess, i just copied the kernel sigcontext)
	and fpregset_t uses __uint128_t (for ld128 float registers).
	if we decide that __uint128 is ok for platforms with 128 bit
	long double then i'll change internal/libm.h etc to avoid the
	ugly endian dependent bithacks
long double:
	printf/scanf/.. should work but some math functions
	are missing/broken now, there is an exp2l patch that
	is needed before this one to make things compile

generic issues (affect other archs too):

sigsetjmp.h
	sigprocmask vs pthread_sigmask: the only difference is errno
	i dont see errno requirement for sigsetjmp so pthread_sigmask should be ok?
reg.h
	sys/reg.h seems to be x86 only (and m68k) in glibc, so probably it should
	be left empty..
shm.h
	shminfo should be under _GNU_SOURCE according to the manual:
	http://man7.org/linux/man-pages/man2/shmctl.2.html
	however shm* is reserved namespace for sys/shm.h
	(i used _GNU_SOURCE in aarch64, others lack it)
termios.h
	i havent tested this much
	but kernel NCCS 32 vs 19 we use in various archs seems inconsistent

View attachment "0001-add-aarch64-port.patch" of type "text/x-diff" (72744 bytes)

Powered by blists - more mailing lists

Confused about mailing lists and their use? Read about mailing lists on Wikipedia and check out these guidelines on proper formatting of your messages.