public inbox for gcc-bugs@sourceware.org help / color / mirror / Atom feed
From: "thiago at kde dot org" <gcc-bugzilla@gcc.gnu.org> To: gcc-bugs@gcc.gnu.org Subject: [Bug c/100005] New: undefined reference to `_rdrand64_step' Date: Fri, 09 Apr 2021 17:10:37 +0000 [thread overview] Message-ID: <bug-100005-4@http.gcc.gnu.org/bugzilla/> (raw) https://gcc.gnu.org/bugzilla/show_bug.cgi?id=100005 Bug ID: 100005 Summary: undefined reference to `_rdrand64_step' Product: gcc Version: 11.0 Status: UNCONFIRMED Severity: normal Priority: P3 Component: c Assignee: unassigned at gcc dot gnu.org Reporter: thiago at kde dot org Target Milestone: --- $ cat rdrand.c #include <immintrin.h> #define NUM_RANDOM_NUMBERS_TO_GENERATE 1024 typedef int (*Generator)(unsigned long long *); int fill_array(Generator generator, unsigned long long *rand_array) { for (int i = 0; i < NUM_RANDOM_NUMBERS_TO_GENERATE; i++) { // fast attempt once: if (__builtin_expect(generator(&rand_array[i]), 1)) continue; // retry up to 16 times int j; for (j = 0; j < 16; ++j) { if (generator(&rand_array[i])) break; } if (j == 16) { // failed, the RNG is out of entropy return -1; } } return 0; } int main() { unsigned long long rand_array[NUM_RANDOM_NUMBERS_TO_GENERATE]; fill_array(_rdrand64_step, rand_array); } $ ~/dev/gcc/bin/gcc -march=haswell -O2 rdrand.c /usr/bin/ld: /tmp/ccTlQIsV.o: in function `main': rdrand.c:(.text.startup+0x8): undefined reference to `_rdrand64_step' collect2: error: ld returned 1 exit status $ ~/dev/gcc/bin/gcc --version gcc (GCC) 11.0.1 20210325 (experimental) Copyright (C) 2021 Free Software Foundation, Inc. This is free software; see the source for copying conditions. There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. Happens in C++ too, including passing as a template parameter.
next reply other threads:[~2021-04-09 17:10 UTC|newest] Thread overview: 19+ messages / expand[flat|nested] mbox.gz Atom feed top 2021-04-09 17:10 thiago at kde dot org [this message] 2021-04-09 17:15 ` [Bug c/100005] " redi at gcc dot gnu.org 2021-04-09 17:20 ` segher at gcc dot gnu.org 2021-04-09 17:27 ` segher at gcc dot gnu.org 2021-04-09 18:05 ` thiago at kde dot org 2021-04-09 18:07 ` jakub at gcc dot gnu.org 2021-04-09 18:11 ` thiago at kde dot org 2021-04-09 18:13 ` jakub at gcc dot gnu.org 2021-04-09 18:23 ` jakub at gcc dot gnu.org 2021-04-09 18:59 ` hjl.tools at gmail dot com 2021-04-09 20:27 ` [Bug target/100005] " jakub at gcc dot gnu.org 2021-04-12 8:05 ` rguenth at gcc dot gnu.org 2021-04-12 15:19 ` thiago at kde dot org 2021-04-12 15:26 ` jakub at gcc dot gnu.org 2021-04-12 15:37 ` thiago at kde dot org 2021-04-12 15:42 ` jakub at gcc dot gnu.org 2021-09-29 8:36 ` pinskia at gcc dot gnu.org 2021-09-29 8:36 ` pinskia at gcc dot gnu.org 2023-06-14 19:11 ` pinskia at gcc dot gnu.org
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 * Reply using the --to, --cc, and --in-reply-to switches of git-send-email(1): git send-email \ --in-reply-to=bug-100005-4@http.gcc.gnu.org/bugzilla/ \ --to=gcc-bugzilla@gcc.gnu.org \ --cc=gcc-bugs@gcc.gnu.org \ /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: linkBe 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).