GNU bug report logs -
#78377
Cross-Compile - "src/make-prime-list: cannot execute: required file not found"
Previous Next
Reported by: NR <nroycea+gnu <at> gmail.com>
Date: Sun, 11 May 2025 15:44:05 UTC
Severity: normal
Tags: fixed
Merged with 12741
Done: Assaf Gordon <assafgordon <at> gmail.com>
Bug is archived. No further changes may be made.
To add a comment to this bug, you must first unarchive it, by sending
a message to control AT debbugs.gnu.org, with unarchive 78377 in the body.
You can then email your comments to 78377 AT debbugs.gnu.org in the normal way.
Toggle the display of automated, internal messages from the tracker.
Report forwarded
to
bug-coreutils <at> gnu.org
:
bug#78377
; Package
coreutils
.
(Sun, 11 May 2025 15:44:05 GMT)
Full text and
rfc822 format available.
Acknowledgement sent
to
NR <nroycea+gnu <at> gmail.com>
:
New bug report received and forwarded. Copy sent to
bug-coreutils <at> gnu.org
.
(Sun, 11 May 2025 15:44:05 GMT)
Full text and
rfc822 format available.
Message #5 received at submit <at> debbugs.gnu.org (full text, mbox):
It'd be nice to be able to cross-compile coreutils.
It could be done by detecting if `--host=` is different from the build system.
If it is different, then make the `src/primes.h` target natively
(specifically the `src/make-prime-list` target).
I noticed it was a very old issue (going back to 2012).
My workaround was just to `configure` without any arguments, `make
src/primes.h`, then `configure` again for cross-compiling, and run a
normal `make`.
Information forwarded
to
bug-coreutils <at> gnu.org
:
bug#78377
; Package
coreutils
.
(Tue, 13 May 2025 15:15:02 GMT)
Full text and
rfc822 format available.
Message #8 received at 78377 <at> debbugs.gnu.org (full text, mbox):
forcemerge 12741 78377
stop
On 11/05/2025 16:26, NR wrote:
> It'd be nice to be able to cross-compile coreutils.
>
> It could be done by detecting if `--host=` is different from the build system.
> If it is different, then make the `src/primes.h` target natively
> (specifically the `src/make-prime-list` target).
>
> I noticed it was a very old issue (going back to 2012).
> My workaround was just to `configure` without any arguments, `make
> src/primes.h`, then `configure` again for cross-compiling, and run a
> normal `make`.
Yes this was discussed at https://bugs.gnu.org/12741
The workaround isn't too onerous,
but yes it would be good to clean this up.
cheers,
Pádraig
Information forwarded
to
bug-coreutils <at> gnu.org
:
bug#78377
; Package
coreutils
.
(Tue, 13 May 2025 17:02:02 GMT)
Full text and
rfc822 format available.
Message #11 received at 78377 <at> debbugs.gnu.org (full text, mbox):
Pádraig Brady <P <at> draigBrady.com> writes:
> The workaround isn't too onerous,
> but yes it would be good to clean this up.
Doesn't crc32 in Gnulib handle this using $(BUILD_CC)? I imagine it
should be simple to do the same here. I can have a look later.
Collin
Information forwarded
to
bug-coreutils <at> gnu.org
:
bug#78377
; Package
coreutils
.
(Tue, 13 May 2025 17:26:02 GMT)
Full text and
rfc822 format available.
Message #14 received at submit <at> debbugs.gnu.org (full text, mbox):
On 2025-05-13 10:01, Collin Funk wrote:
> Doesn't crc32 in Gnulib handle this using $(BUILD_CC)? I imagine it
> should be simple to do the same here. I can have a look later.
Yes, that should work, so long as the build host isn't a Microsoft
Windows platform that would require $(BUILD_EXEEXT). And that should be
good enough; we don't need the full power of AX_PROG_CC_FOR_BUILD from
the Autoconf Archive.
Information forwarded
to
bug-coreutils <at> gnu.org
:
bug#78377
; Package
coreutils
.
(Fri, 16 May 2025 05:37:01 GMT)
Full text and
rfc822 format available.
Message #17 received at 78377 <at> debbugs.gnu.org (full text, mbox):
[Message part 1 (text/plain, inline)]
Hi Paul,
Paul Eggert <eggert <at> cs.ucla.edu> writes:
> Yes, that should work, so long as the build host isn't a Microsoft
> Windows platform that would require $(BUILD_EXEEXT). And that should
> be good enough; we don't need the full power of AX_PROG_CC_FOR_BUILD
> from the Autoconf Archive.
Here is a patch that worked in an x86 docker container with an arm64
cross compiler.
Can we just assume that crc will always be used and depend on
build-cc.m4? I guess the more robust way to do things is to do the
following in bootstrap.conf:
bootstrap_post_import_hook ()
{
$gnulib_tool --copy-file m4/build-cc.m4
}
Like we do for tests/init.sh.
Collin
[0001-build-allow-make-prime-list-to-build-when-cross-comp.patch (text/x-patch, attachment)]
Information forwarded
to
bug-coreutils <at> gnu.org
:
bug#78377
; Package
coreutils
.
(Fri, 16 May 2025 12:17:02 GMT)
Full text and
rfc822 format available.
Message #20 received at 78377 <at> debbugs.gnu.org (full text, mbox):
On 16/05/2025 06:36, Collin Funk wrote:
> Hi Paul,
>
> Paul Eggert <eggert <at> cs.ucla.edu> writes:
>
>> Yes, that should work, so long as the build host isn't a Microsoft
>> Windows platform that would require $(BUILD_EXEEXT). And that should
>> be good enough; we don't need the full power of AX_PROG_CC_FOR_BUILD
>> from the Autoconf Archive.
>
> Here is a patch that worked in an x86 docker container with an arm64
> cross compiler.
>
> Can we just assume that crc will always be used and depend on
> build-cc.m4? I guess the more robust way to do things is to do the
> following in bootstrap.conf:
>
> bootstrap_post_import_hook ()
> {
> $gnulib_tool --copy-file m4/build-cc.m4
> }
>
> Like we do for tests/init.sh.
Well given we also need to call gl_BUILD_CC perhaps the
best way would be to have a separate build-cc gnulib module
and have the crc module depend on that. I'm fine just depending
on crc for now though, though I can see a build-cc gnulib module
being generally useful.
Talking about crc, given our crctab.c has expanded recently,
it probably makes sense to generate that at build time also.
The patch looks good, and I tested with:
make BUILD_CC=clang BUILD_CFLAGS=-m32 V=1
I'll apply later and squash the following in
to avoid `make syntax-check` failures,
and remove a stale entry from .gitignore.
thank you!
Pádraig
diff --git a/.gitignore b/.gitignore
index bafeb2bc5..ba7344994 100644
--- a/.gitignore
+++ b/.gitignore
@@ -201,7 +201,6 @@
/src/fs-kernel-magic
/src/fs-latest-magic.h
/src/fs-magic
-/src/make-prime-list
/src/primes.h
/src/single-binary.mk
/src/version.c
diff --git a/cfg.mk b/cfg.mk
index e147d4ae7..fa032f52e 100644
--- a/cfg.mk
+++ b/cfg.mk
@@ -869,7 +869,7 @@ exclude_file_name_regexp--sc_system_h_headers = \
^src/((system|copy|chown-core|find-mount-point)\.h|make-prime-list\.c)$$
_src := (false|lbracket|chown-(chgrp|chown)
-_src := $(_src)|ls-(dir|ls|vdir)|tac-pipe|uname-(arch|uname))
+_src := $(_src)|ls-(dir|ls|vdir)|make-prime-list|tac-pipe|uname-(arch|uname))
_gl_src = (xdecto.max|cl-strtold)
exclude_file_name_regexp--sc_require_config_h_first = \
(^lib/buffer-lcm\.c|gl/lib/$(_gl_src)\.c|src/$(_src)\.c)$$
@@ -921,8 +921,10 @@ exclude_file_name_regexp--sc_prohibit_operator_at_end_of_line = \
exclude_file_name_regexp--sc_error_message_uppercase = ^src/factor\.c$$
exclude_file_name_regexp--sc_prohibit_atoi_atof = ^src/make-prime-list\.c$$
-# Exception here as we don't want __attribute elided on non GCC
-exclude_file_name_regexp--sc_prohibit-gl-attributes = ^src/libstdbuf\.c$$
+# Exception here as we don't want __attribute elided on non GCC for stdbuf
+# and we don't want to depend on gnulib for make-prime-list
+exclude_file_name_regexp--sc_prohibit-gl-attributes = \
+ ^src/(make-prime-list|libstdbuf)\.c$$
exclude_file_name_regexp--sc_prohibit_uppercase_id_est = \.diff$$
exclude_file_name_regexp--sc_ensure_dblspace_after_dot_before_id_est = \.diff$$
diff --git a/src/local.mk b/src/local.mk
index 833c714e1..68c7db63a 100644
--- a/src/local.mk
+++ b/src/local.mk
@@ -559,8 +559,8 @@ $(top_srcdir)/src/primes.h: $(top_srcdir)/src/make-prime-list.c
$(MKDIR_P) $(top_srcdir)/src/primes-tmp \
&& (cd $(top_srcdir)/src/primes-tmp \
&& $(BUILD_CC) $(BUILD_CPPFLAGS) $(BUILD_CFLAGS) \
- $(BUILD_LDFLAGS) -o make-prime-list$(EXEEXT) \
- $(abs_top_srcdir)/src/make-prime-list.c) \
+ $(BUILD_LDFLAGS) -o make-prime-list$(EXEEXT) \
+ $(abs_top_srcdir)/src/make-prime-list.c) \
&& rm -f $@ $@-t \
&& $(top_srcdir)/src/primes-tmp/make-prime-list$(EXEEXT) \
5000 > $@-t \
Information forwarded
to
bug-coreutils <at> gnu.org
:
bug#78377
; Package
coreutils
.
(Sat, 17 May 2025 03:22:02 GMT)
Full text and
rfc822 format available.
Message #23 received at 78377 <at> debbugs.gnu.org (full text, mbox):
Hi Pádraig,
Pádraig Brady <P <at> draigBrady.com> writes:
> Well given we also need to call gl_BUILD_CC perhaps the
> best way would be to have a separate build-cc gnulib module
> and have the crc module depend on that. I'm fine just depending
> on crc for now though, though I can see a build-cc gnulib module
> being generally useful.
Yeah, that sounds better. But since it seems Coreutils is the only one
using it I am not in a rush to do it. :)
> Talking about crc, given our crctab.c has expanded recently,
> it probably makes sense to generate that at build time also.
I can have a look at that. Seems fairly simple.
> The patch looks good, and I tested with:
> make BUILD_CC=clang BUILD_CFLAGS=-m32 V=1
>
> I'll apply later and squash the following in
> to avoid `make syntax-check` failures,
> and remove a stale entry from .gitignore.
Thanks! I forgot to run 'make syntax-check'.
Collin
Forcibly Merged 12741 78377.
Request was from
Pádraig Brady <P <at> draigBrady.com>
to
control <at> debbugs.gnu.org
.
(Sat, 17 May 2025 07:52:02 GMT)
Full text and
rfc822 format available.
Information forwarded
to
bug-coreutils <at> gnu.org
:
bug#78377
; Package
coreutils
.
(Sat, 17 May 2025 08:25:02 GMT)
Full text and
rfc822 format available.
Message #28 received at 78377 <at> debbugs.gnu.org (full text, mbox):
On 17/05/2025 04:21, Collin Funk wrote:
> Hi Pádraig,
>
> Pádraig Brady <P <at> draigBrady.com> writes:
>
>> Well given we also need to call gl_BUILD_CC perhaps the
>> best way would be to have a separate build-cc gnulib module
>> and have the crc module depend on that. I'm fine just depending
>> on crc for now though, though I can see a build-cc gnulib module
>> being generally useful.
>
> Yeah, that sounds better. But since it seems Coreutils is the only one
> using it I am not in a rush to do it. :)
>
>> Talking about crc, given our crctab.c has expanded recently,
>> it probably makes sense to generate that at build time also.
>
> I can have a look at that. Seems fairly simple.
Great, much appreciated.
I adjusted the commit message to mention this
was only an issue when building from git,
as we distribute primes.h in tarballs.
I also mentioned this bug number in the commit message.
Pushed.
Marking as done.
thanks!
Pádraig.
bug archived.
Request was from
Debbugs Internal Request <help-debbugs <at> gnu.org>
to
internal_control <at> debbugs.gnu.org
.
(Sat, 14 Jun 2025 11:24:14 GMT)
Full text and
rfc822 format available.
This bug report was last modified today.
Previous Next
GNU bug tracking system
Copyright (C) 1999 Darren O. Benham,
1997,2003 nCipher Corporation Ltd,
1994-97 Ian Jackson.