bug-gnulib@gnu.org mirror (unofficial)
 help / color / mirror / Atom feed
From: Po Lu <luangruo@yahoo.com>
To: Paul Eggert <eggert@cs.ucla.edu>
Cc: bug-gnulib@gnu.org
Subject: Re: getrandom not replaced
Date: Mon, 26 Dec 2022 11:36:42 +0800	[thread overview]
Message-ID: <87cz86n8dx.fsf@yahoo.com> (raw)
In-Reply-To: <eef3aef3-082a-56aa-63dc-2207f6aa891a@cs.ucla.edu> (Paul Eggert's message of "Sun, 25 Dec 2022 19:12:49 -0800")

Paul Eggert <eggert@cs.ucla.edu> writes:

> I meant to use the compiler that is actually used to compile
> lib/getrandom.c. You can deduce this with something like this:
>
> rm lib/getrandom.o; cd lib; make V=1 getrandom.o
>
> and replace '-c -o getrandom.o' with '-E' in the resulting command.
>
>
>> #if 1
>> /* Fill a buffer with random bytes.  */
>> # if 0
>> #  if !(defined __cplusplus && defined GNULIB_NAMESPACE)
>> #   undef getrandom
>> #   define getrandom rpl_getrandom
>> #  endif
>> _GL_FUNCDECL_RPL (getrandom, ssize_t,
>>                    (void *buffer, size_t length, unsigned int flags)
>>                    _GL_ARG_NONNULL ((1)));
>> _GL_CXXALIAS_RPL (getrandom, ssize_t,
>>                    (void *buffer, size_t length, unsigned int flags));
>> # else
>> #  if !0
>> _GL_FUNCDECL_SYS (getrandom, ssize_t,
>>                    (void *buffer, size_t length, unsigned int flags)
>>                    _GL_ARG_NONNULL ((1)));
>
> That last decl should have been reached and should have declared
> 'getrandom', but evidently it didn't. This is where the -E output
> would be helpful.

Thanks.  I found the problem later on: $(top_srcdir)/lib/sys/random.h
was being included by the #include_next statement at the beginning,
leading to gnulib configuration on the host leaking through to the
out-of-tree cross-compile.

Sorry for the noise.


      reply	other threads:[~2022-12-26  3:37 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <87lemvm0qf.fsf.ref@yahoo.com>
2022-12-26  1:07 ` getrandom not replaced Po Lu
2022-12-26  1:19   ` Bruno Haible
2022-12-27  4:40     ` Po Lu
2022-12-26  2:38   ` Paul Eggert
2022-12-26  2:50     ` Po Lu
2022-12-26  3:12       ` Paul Eggert
2022-12-26  3:36         ` Po Lu [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://lists.gnu.org/mailman/listinfo/bug-gnulib

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=87cz86n8dx.fsf@yahoo.com \
    --to=luangruo@yahoo.com \
    --cc=bug-gnulib@gnu.org \
    --cc=eggert@cs.ucla.edu \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).