[PATCH] support: add __address_diff function
Florian Weimer
fweimer@redhat.com
Wed Mar 25 16:40:20 GMT 2026
* Yury Khrustalev:
> On Wed, Mar 25, 2026 at 03:18:35PM +0100, Florian Weimer wrote:
>> * Yury Khrustalev:
>>
>> >> The #ifdef is not necessary, sysdeps overrides should work for support/
>> >> headers.
>> >
>> > I've tried this but it doesn't seem to be working. Ideally, I want to
>> > have the support_pointer_arith.c file only under sysdeps/aarch64 because
>> > for all other targets the PTR_DIFF macro should be used, but makefile in
>> > the support folder should probably be modified for this?
>>
>> I don't know what exactly you tried to do. I recall that it worked for
>> me in the past, but I don't remember the details. We only use sysdeps
>> overrides for compilation flags today AFAICS.
>
> I can't find any existing example of adding to 'libsupport-routines'
> anywhere under 'sysdeps'. I tried doing it, and corresponding object is
> not included in the libsupport static library.
Ahh. Easiest way is to make it an out-of-line definition every, so the
.c file already exists in support/.
Alternatively, you could add it like this:
ifeq ($(subdir), support)
libsupport-sysdep_routines += \
support_pointer_arith \
# sysdep_routines
endif
in sysdeps/aarch64/Makefile. We use this for libm and libmvec, so I
assume it actually works.
Thanks,
Florian
More information about the Libc-alpha
mailing list