From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.org/gmane.linux.lib.musl.general/7172 Path: news.gmane.org!not-for-mail From: Rich Felker Newsgroups: gmane.linux.lib.musl.general Subject: Re: aarch64 port Date: Mon, 9 Mar 2015 23:03:42 -0400 Message-ID: <20150310030342.GB23507@brightrain.aerifal.cx> References: <20150309185058.GL16260@port70.net> <20150309190800.GZ23507@brightrain.aerifal.cx> <20150310024446.GN16260@port70.net> Reply-To: musl@lists.openwall.com NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Trace: ger.gmane.org 1425956648 30940 80.91.229.3 (10 Mar 2015 03:04:08 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Tue, 10 Mar 2015 03:04:08 +0000 (UTC) To: musl@lists.openwall.com Original-X-From: musl-return-7185-gllmg-musl=m.gmane.org@lists.openwall.com Tue Mar 10 04:04:01 2015 Return-path: Envelope-to: gllmg-musl@m.gmane.org Original-Received: from mother.openwall.net ([195.42.179.200]) by plane.gmane.org with smtp (Exim 4.69) (envelope-from ) id 1YVASf-0008NH-KT for gllmg-musl@m.gmane.org; Tue, 10 Mar 2015 04:04:01 +0100 Original-Received: (qmail 26480 invoked by uid 550); 10 Mar 2015 03:04:00 -0000 Mailing-List: contact musl-help@lists.openwall.com; run by ezmlm Precedence: bulk List-Post: List-Help: List-Unsubscribe: List-Subscribe: Original-Received: (qmail 26423 invoked from network); 10 Mar 2015 03:03:54 -0000 Content-Disposition: inline In-Reply-To: <20150310024446.GN16260@port70.net> User-Agent: Mutt/1.5.21 (2010-09-15) Original-Sender: Rich Felker Xref: news.gmane.org gmane.linux.lib.musl.general:7172 Archived-At: On Tue, Mar 10, 2015 at 03:44:46AM +0100, Szabolcs Nagy wrote: > * Rich Felker [2015-03-09 15:08:00 -0400]: > > On Mon, Mar 09, 2015 at 07:50:58PM +0100, Szabolcs Nagy wrote: > > > should work, relocs lisghtly tested, but vdso does not work > > > yet (at least i see clock_gettime syscalls in strace) > > > > vdso is unrelated to the dynamic linker. You have to add macros in > > syscall_arch.h to inform clock_gettime that vdso is useful, and what > > vdso works now Great! Can you confirm whether enabling it on 32-bit ARM would be okay too? I've been unable to get a setup with the right hardware/kernel combination for testing and I don't want to commit completely untested support. > > > __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? > > > > For dynamic linking, yes, as long as libc.so is under 1M. But for > > static linking, probably not. In principle __cancel and > > __syscall_cp_asm could be far away in a huge static binary. > > > > hm pc relative branches have limited range, maybe i should use > barnch to register with some address calculation? what's the best > way to do that? > > for now i used a branch with +-128M range On most 64-bit archs a sort of "small model" is in effect where any given DSO's code/data is assumed to be addressible with signed 32-bit PC-relative addresses. So I think ±128M is more than sufficient. > > > __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 > > > > Yes, I'd like to add a copy (or just move it) at the end contingent > > upon TLS_ABOVE_TP. > > i just added a todo about this Would you like me to make this change prior to committing aarch64 so you could use the assumption that dtv is accessible at a fixed small offset? > > > 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? > > > > I don't follow. > > > > sorry i was thinking that now that the kernel has generic syscalls > we could use one syscall.h (it is fairly big and could be shared > between every new arch) only a few syscalls need to be different > on 32bit vs 64bit archs > > for now i made syscall.h 64bit only (the 32bit version is in or1k/bits) Yes, it would be really nice to move to an arch/bits form with base files and only limited arch-specific overrides, and having all the bits headers be generated (or maybe even inlined into their respective top-level header files to eliminate bits?). > > > 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 > > > > I'll look. Perhaps just including a long double element or similar can > > get the desired effect portably. > > > > see mcontext_t in bits/signal.h and user_fpsimd_struct in bits/user.h > > i added todo comment for now OK. Just checked it and it seems like __reserved could just have type long double (or a union containing long double) in both the full and namespace-safe versions. > > > 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 > > > > Broken (bad accuracy) is OK for now, but we should probably fix any > > missing symbols. > > > > i can add dummy long double functions that map to the double version > > missing ones (not counting complex): Are the complex ones ld-format-specific anyway? I figured they would just be written in terms of real ld functions. > acoshl > asinhl > atanhl > coshl > erfcl > erfl > expl > expm1l > lgammal > log10l > log1pl > log2l > sinhl > tanhl > tgammal Thanks for the list. > > > 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) > > > > I prefer to keep FTM checks out of the bits headers as much as possible. > > ok removed it OK. BTW the rationale here is that errors or need for changes in FTM behavior are easily overlooked if they're tucked away in arch-specific places. > > > termios.h > > > i havent tested this much > > > but kernel NCCS 32 vs 19 we use in various archs seems inconsistent > > > > glibc generally does its own thing rather than matching the kernel. We > > do a sort of ugly mix I think... I'd need to check again to be sure > > though. > > i think ioctl and termios should be checked against the kernel > if we are up to date (not just for aarch64) but it's painful.. Yes and yes (that it should be checked, and that checking is painful). > i changed the pthread types to match x86_64 as that seems to me > the most reasonable approach Yes that's the way I'm leaning -- 40-byte rather than 32-byte. Having the pthread types in the shared part of alltypes.h.in would be very nice. > attached an incremental diff I don't see any issues in it aside from what's already being discussed. Rich