Oh, it really seems to be my mistake. I was using my own build script to build and install uclibc-ng (together with some other packages) and I was passing ASFLAGS among other common variables to make invocation.

Removing ASFLAGS from make invocation fixes the build error. Thank you for pointing out.

- Kirill Makurin

From: Waldemar Brodkorb <wbx@openadk.org>
Sent: Monday, May 26, 2025 11:22 PM
To: Kirill Makurin <maiddaisuki@outlook.com>
Cc: devel@uclibc-ng.org <devel@uclibc-ng.org>
Subject: Re: [uclibc-ng-devel] Re: build error for x86_64 with NPTL
 
Hi Kirill,
Kirill Makurin wrote,

> I attached the config I am currently using. It enables most of library
> features, except for some glibc-compatibility and obsolete stuff.
>
> I was doing native compilation on a Debian 12 system (gcc 12.2, binutils 2.40),
> but I was using Linux headers v6.14 for the build.
>
> Compilation fails with the following diagnostic:
>
> ```
> libpthread/nptl/sysdeps/unix/sysv/linux/x86_64/sem_wait.S:122:3: error: #error
> "not supported.  %rcx and %rdi must be preserved"
> 122 | # error "not supported.  %rcx and %rdi must be preserve
>          |   ^~~~~
>
> ```
>
> As I have mentioned, including tls.h from this file seems to fix the issue.

Hmm, I can't reproduce the issue. Makefile.arch does set ASFLAGS.
Did you override ASFLAGS somehow in your environment overwriting the
default from uClibc-ng?
 
 best regards
  Waldemar