Makefile* Problem Adding C23 stdbits Functions

Joel Sherrill <[email protected]> Tue, 10 Mar 2026 16:27:48 -0500
Newsgroups gmane.comp.lib.newlib
Message-ID <CAF9ehCWdEst7maMNjR=rc2s57X5nDCYD4GE=S=DAHGWhSEJpqA@mail.gmail.com>
Hi

I am in the process of adding FreeBSD's implementation of stdbit.h
functions to newlib. I am attaching just the changes to libc/Makefile.inc
and the new libc/stdbit/Makefile.inc. I ran autoreconf from newlib. The
versions are:

autoconf (GNU Autoconf) 2.69
automake (GNU automake) 1.16.5

When I ran autoreconf, there were no warnings or errors but when I build,
there is this error:

===========================
config.status:1583: cd .       && sed -e '/# am--include-marker/d' Makefile
        | make -f - am--depfiles
make[2]: Entering directory
'/home/joel/test-gcc/b-sparc-rtems7-newlib/sparc-rtems7/newlib'
/tmp/GmySNETs:14839: *** mixed implicit and normal rules.  Stop.
make[2]: Leaving directory
'/home/joel/test-gcc/b-sparc-rtems7-newlib/sparc-rtems7/newlib'
config.status:1588: $? = 2
config.status:1592: error: in
`/home/joel/test-gcc/b-sparc-rtems7-newlib/sparc-rtems7/newlib':
config.status:1594: error: Something went wrong bootstrapping makefile
fragments
    for automatic dependency tracking.  If GNU make was not used, consider
    re-running the configure script with MAKE="gmake" (or whatever is
    necessary).  You can also try re-running configure with the
    '--disable-dependency-tracking' option to at least be able to build
    the package (albeit without support for automatic dependency tracking).
See `config.log' for more details
===========================

The above is from the config.log file which has the information on the
failure.

I thought this would be simple given the new-ish Makefile.inc system.

Any suggestions?

--joel
0001-Makefile.inc-stdbit-Makefile.inc-Makefile-changes.patch (application/octet-stream, 1.5 KB)
From 008eac8c951efbcd70a0fdd4e2bebdaf2dafd2da Mon Sep 17 00:00:00 2001
From: Joel Sherrill <[email protected]>
Date: Tue, 10 Mar 2026 15:57:39 -0500
Subject: [PATCH] Makefile.inc, stdbit/Makefile.inc: Makefile changes

---
 newlib/libc/Makefile.inc        |  1 +
 newlib/libc/stdbit/Makefile.inc | 15 +++++++++++++++
 2 files changed, 16 insertions(+)
 create mode 100644 newlib/libc/stdbit/Makefile.inc

diff --git a/newlib/libc/Makefile.inc b/newlib/libc/Makefile.inc
index d07eed764..565156257 100644
--- a/newlib/libc/Makefile.inc
+++ b/newlib/libc/Makefile.inc
@@ -41,6 +41,7 @@ install-man: %C%_install-man
 ## Also keep in mind that every subdir must always be included here.  Any
 ## conditional loigc must live in the respective Makefile.inc files.
 include %D%/argz/Makefile.inc
+include %D%/stdbit/Makefile.inc
 include %D%/stdlib/Makefile.inc
 include %D%/ctype/Makefile.inc
 include %D%/search/Makefile.inc
diff --git a/newlib/libc/stdbit/Makefile.inc b/newlib/libc/stdbit/Makefile.inc
new file mode 100644
index 000000000..0f91f6797
--- /dev/null
+++ b/newlib/libc/stdbit/Makefile.inc
@@ -0,0 +1,15 @@
+libc_a_SOURCES += \
+	%D/stdc_bit_ceil.c \
+	%D/stdc_bit_floor.c \
+	%D/stdc_bit_width.c \
+	%D/stdc_count_ones.c \
+	%D/stdc_count_zeros.c \
+	%D/stdc_first_leading_one.c \
+	%D/stdc_first_leading_zero.c \
+	%D/stdc_first_trailing_one.c \
+	%D/stdc_first_trailing_zero.c \
+	%D/stdc_has_single_bit.c \
+	%D/stdc_leading_ones.c \
+	%D/stdc_leading_zeros.c \
+	%D/stdc_trailing_ones.c \
+	%D/stdc_trailing_zeros.c
-- 
2.47.3