public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug c/104363] New: hppa: __asm__ directive .global and multiple .symver not supported
@ 2022-02-03  9:34 mathieu.malaterre at gmail dot com
  2022-02-03  9:38 ` [Bug target/104363] " pinskia at gcc dot gnu.org
                   ` (10 more replies)
  0 siblings, 11 replies; 12+ messages in thread
From: mathieu.malaterre at gmail dot com @ 2022-02-03  9:34 UTC (permalink / raw)
  To: gcc-bugs

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=104363

            Bug ID: 104363
           Summary: hppa: __asm__ directive .global and multiple .symver
                    not supported
           Product: gcc
           Version: 11.2.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: c
          Assignee: unassigned at gcc dot gnu.org
          Reporter: mathieu.malaterre at gmail dot com
  Target Milestone: ---

It looks like there is a regression on gcc/11 branch on hppa.

Steps using gcc-10 (Debian/buster):

% sudo apt-get install g++-hppa-linux-gnu
% wget http://www.chronox.de/libkcapi/libkcapi-1.3.1.tar.xz
% tar xf libkcapi-1.3.1.tar.xz
% cd libkcapi-1.3.1
% autoreconf -i
% ./configure  --host=hppa-linux-gnu  --build=x86_64-linux-gnu 
--enable-kcapi-rngapp
% make -j8

=> success !

Compare now on Debian/sid:

% sudo apt-get install g++-hppa-linux-gnu
% wget http://www.chronox.de/libkcapi/libkcapi-1.3.1.tar.xz
% tar xf libkcapi-1.3.1.tar.xz
% cd libkcapi-1.3.1
% autoreconf -i
% ./configure  --host=hppa-linux-gnu  --build=x86_64-linux-gnu 
--enable-kcapi-rngapp
% make -j8
/bin/bash ./libtool  --tag=CC   --mode=link hppa-linux-gnu-gcc  -g -O2 -fpie
-fPIE -DPIE -Wl,-z,relro,-z,now -pie -o bin/kcapi-rng
apps/bin_kcapi_rng-kcapi-rng.o apps/bin_kcapi_rng-app-internal.o libkcapi.la
libtool: link: hppa-linux-gnu-gcc -g -O2 -fpie -fPIE -DPIE -Wl,-z -Wl,relro
-Wl,-z -Wl,now -pie -o bin/.libs/kcapi-rng apps/bin_kcapi_rng-kcapi-rng.o
apps/bin_kcapi_rng-app-internal.o  ./.libs/libkcapi.so
/usr/lib/gcc-cross/hppa-linux-gnu/11/../../../../hppa-linux-gnu/bin/ld:
apps/bin_kcapi_rng-kcapi-rng.o: in function `main':
/tmp/libkcapi-1.3.1/apps/kcapi-rng.c:302: undefined reference to
`kcapi_rng_generate'
/usr/lib/gcc-cross/hppa-linux-gnu/11/../../../../hppa-linux-gnu/bin/ld:
/tmp/libkcapi-1.3.1/apps/kcapi-rng.c:328: undefined reference to
`kcapi_memset_secure'
/usr/lib/gcc-cross/hppa-linux-gnu/11/../../../../hppa-linux-gnu/bin/ld:
/tmp/libkcapi-1.3.1/apps/kcapi-rng.c:332: undefined reference to
`kcapi_memset_secure'
/usr/lib/gcc-cross/hppa-linux-gnu/11/../../../../hppa-linux-gnu/bin/ld:
/tmp/libkcapi-1.3.1/apps/kcapi-rng.c:328: undefined reference to
`kcapi_memset_secure'
/usr/lib/gcc-cross/hppa-linux-gnu/11/../../../../hppa-linux-gnu/bin/ld:
/tmp/libkcapi-1.3.1/apps/kcapi-rng.c:328: undefined reference to
`kcapi_memset_secure'
/usr/lib/gcc-cross/hppa-linux-gnu/11/../../../../hppa-linux-gnu/bin/ld:
./.libs/libkcapi.so: undefined reference to `kcapi_aead_stream_init_enc'
/usr/lib/gcc-cross/hppa-linux-gnu/11/../../../../hppa-linux-gnu/bin/ld:
./.libs/libkcapi.so: undefined reference to `kcapi_cipher_stream_init_enc'
/usr/lib/gcc-cross/hppa-linux-gnu/11/../../../../hppa-linux-gnu/bin/ld:
./.libs/libkcapi.so: undefined reference to `kcapi_cipher_stream_init_dec'
/usr/lib/gcc-cross/hppa-linux-gnu/11/../../../../hppa-linux-gnu/bin/ld:
./.libs/libkcapi.so: undefined reference to `kcapi_cipher_encrypt'
/usr/lib/gcc-cross/hppa-linux-gnu/11/../../../../hppa-linux-gnu/bin/ld:
./.libs/libkcapi.so: undefined reference to `kcapi_md_final'
/usr/lib/gcc-cross/hppa-linux-gnu/11/../../../../hppa-linux-gnu/bin/ld:
./.libs/libkcapi.so: undefined reference to `kcapi_pbkdf'
/usr/lib/gcc-cross/hppa-linux-gnu/11/../../../../hppa-linux-gnu/bin/ld:
./.libs/libkcapi.so: undefined reference to `kcapi_cipher_stream_op'
/usr/lib/gcc-cross/hppa-linux-gnu/11/../../../../hppa-linux-gnu/bin/ld:
./.libs/libkcapi.so: undefined reference to `kcapi_cipher_decrypt'
/usr/lib/gcc-cross/hppa-linux-gnu/11/../../../../hppa-linux-gnu/bin/ld:
./.libs/libkcapi.so: undefined reference to `kcapi_aead_stream_op'
/usr/lib/gcc-cross/hppa-linux-gnu/11/../../../../hppa-linux-gnu/bin/ld:
./.libs/libkcapi.so: undefined reference to `kcapi_aead_stream_update_last'
/usr/lib/gcc-cross/hppa-linux-gnu/11/../../../../hppa-linux-gnu/bin/ld:
./.libs/libkcapi.so: undefined reference to `kcapi_aead_stream_init_dec'
/usr/lib/gcc-cross/hppa-linux-gnu/11/../../../../hppa-linux-gnu/bin/ld:
./.libs/libkcapi.so: undefined reference to `kcapi_md_digest'
collect2: error: ld returned 1 exit status
make: *** [Makefile:953: bin/kcapi-rng] Error 1
make: *** Waiting for unfinished jobs....
rm /tmp/tmp.b3eRUtQTiC

^ permalink raw reply	[flat|nested] 12+ messages in thread

* [Bug target/104363] hppa: __asm__ directive .global and multiple .symver not supported
  2022-02-03  9:34 [Bug c/104363] New: hppa: __asm__ directive .global and multiple .symver not supported mathieu.malaterre at gmail dot com
@ 2022-02-03  9:38 ` pinskia at gcc dot gnu.org
  2022-02-03  9:45 ` mathieu.malaterre at gmail dot com
                   ` (9 subsequent siblings)
  10 siblings, 0 replies; 12+ messages in thread
From: pinskia at gcc dot gnu.org @ 2022-02-03  9:38 UTC (permalink / raw)
  To: gcc-bugs

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=104363

Andrew Pinski <pinskia at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
     Ever confirmed|0                           |1
             Target|                            |hppa-linux-gnu
             Status|UNCONFIRMED                 |WAITING
          Component|c                           |target
   Last reconfirmed|                            |2022-02-03

--- Comment #1 from Andrew Pinski <pinskia at gcc dot gnu.org> ---
What binutils version is being used are they different?
Are you sure this is not a bug in binutils since that is what processes symver
assembly.

^ permalink raw reply	[flat|nested] 12+ messages in thread

* [Bug target/104363] hppa: __asm__ directive .global and multiple .symver not supported
  2022-02-03  9:34 [Bug c/104363] New: hppa: __asm__ directive .global and multiple .symver not supported mathieu.malaterre at gmail dot com
  2022-02-03  9:38 ` [Bug target/104363] " pinskia at gcc dot gnu.org
@ 2022-02-03  9:45 ` mathieu.malaterre at gmail dot com
  2022-02-03  9:47 ` mathieu.malaterre at gmail dot com
                   ` (8 subsequent siblings)
  10 siblings, 0 replies; 12+ messages in thread
From: mathieu.malaterre at gmail dot com @ 2022-02-03  9:45 UTC (permalink / raw)
  To: gcc-bugs

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=104363

--- Comment #2 from Mathieu Malaterre <mathieu.malaterre at gmail dot com> ---
I've downgraded binutils to version from bullseye, and I am getting the exact
same symptoms:

```
libtool: link: ( cd ".libs" && rm -f "libkcapi.la" && ln -s "../libkcapi.la"
"libkcapi.la" )
/bin/bash ./libtool  --tag=CC   --mode=link hppa-linux-gnu-gcc  -g -O2 -fpie
-fPIE -DPIE -Wl,-z,relro,-z,now -pie -o bin/kcapi-rng
apps/bin_kcapi_rng-kcapi-rng.o apps/bin_kcapi_rng-app-internal.o libkcapi.la
libtool: link: hppa-linux-gnu-gcc -g -O2 -fpie -fPIE -DPIE -Wl,-z -Wl,relro
-Wl,-z -Wl,now -pie -o bin/.libs/kcapi-rng apps/bin_kcapi_rng-kcapi-rng.o
apps/bin_kcapi_rng-app-internal.o  ./.libs/libkcapi.so
/usr/lib/gcc-cross/hppa-linux-gnu/11/../../../../hppa-linux-gnu/bin/ld:
apps/bin_kcapi_rng-kcapi-rng.o: in function `main':
/tmp/libkcapi-1.3.1/apps/kcapi-rng.c:302: undefined reference to
`kcapi_rng_generate'
/usr/lib/gcc-cross/hppa-linux-gnu/11/../../../../hppa-linux-gnu/bin/ld:
/tmp/libkcapi-1.3.1/apps/kcapi-rng.c:328: undefined reference to
`kcapi_memset_secure'
```

 % apt-cache policy binutils-hppa-linux-gnu
binutils-hppa-linux-gnu:
  Installed: 2.35.2-2
  Candidate: 2.37.90.20220130-2
  Version table:
     2.37.90.20220130-2 500
        500 http://deb.debian.org/debian sid/main amd64 Packages
 *** 2.35.2-2 100
        100 /var/lib/dpkg/status

^ permalink raw reply	[flat|nested] 12+ messages in thread

* [Bug target/104363] hppa: __asm__ directive .global and multiple .symver not supported
  2022-02-03  9:34 [Bug c/104363] New: hppa: __asm__ directive .global and multiple .symver not supported mathieu.malaterre at gmail dot com
  2022-02-03  9:38 ` [Bug target/104363] " pinskia at gcc dot gnu.org
  2022-02-03  9:45 ` mathieu.malaterre at gmail dot com
@ 2022-02-03  9:47 ` mathieu.malaterre at gmail dot com
  2022-02-03 11:18 ` pinskia at gcc dot gnu.org
                   ` (7 subsequent siblings)
  10 siblings, 0 replies; 12+ messages in thread
From: mathieu.malaterre at gmail dot com @ 2022-02-03  9:47 UTC (permalink / raw)
  To: gcc-bugs

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=104363

--- Comment #3 from Mathieu Malaterre <mathieu.malaterre at gmail dot com> ---
Original description states:

> Steps using gcc-10 (Debian/buster):

This is a typo, it should states:

> Steps using gcc-10 (Debian/bullseye):

^ permalink raw reply	[flat|nested] 12+ messages in thread

* [Bug target/104363] hppa: __asm__ directive .global and multiple .symver not supported
  2022-02-03  9:34 [Bug c/104363] New: hppa: __asm__ directive .global and multiple .symver not supported mathieu.malaterre at gmail dot com
                   ` (2 preceding siblings ...)
  2022-02-03  9:47 ` mathieu.malaterre at gmail dot com
@ 2022-02-03 11:18 ` pinskia at gcc dot gnu.org
  2022-02-03 11:19 ` pinskia at gcc dot gnu.org
                   ` (6 subsequent siblings)
  10 siblings, 0 replies; 12+ messages in thread
From: pinskia at gcc dot gnu.org @ 2022-02-03 11:18 UTC (permalink / raw)
  To: gcc-bugs

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=104363

--- Comment #4 from Andrew Pinski <pinskia at gcc dot gnu.org> ---
Can you provide an easier testcase that shows the issue?

^ permalink raw reply	[flat|nested] 12+ messages in thread

* [Bug target/104363] hppa: __asm__ directive .global and multiple .symver not supported
  2022-02-03  9:34 [Bug c/104363] New: hppa: __asm__ directive .global and multiple .symver not supported mathieu.malaterre at gmail dot com
                   ` (3 preceding siblings ...)
  2022-02-03 11:18 ` pinskia at gcc dot gnu.org
@ 2022-02-03 11:19 ` pinskia at gcc dot gnu.org
  2022-02-03 17:13 ` danglin at gcc dot gnu.org
                   ` (5 subsequent siblings)
  10 siblings, 0 replies; 12+ messages in thread
From: pinskia at gcc dot gnu.org @ 2022-02-03 11:19 UTC (permalink / raw)
  To: gcc-bugs

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=104363

--- Comment #5 from Andrew Pinski <pinskia at gcc dot gnu.org> ---
(In reply to Mathieu Malaterre from comment #2)
> I've downgraded binutils to version from bullseye, and I am getting the
> exact same symptoms:

Did you build from scratch or reuse the object files?

^ permalink raw reply	[flat|nested] 12+ messages in thread

* [Bug target/104363] hppa: __asm__ directive .global and multiple .symver not supported
  2022-02-03  9:34 [Bug c/104363] New: hppa: __asm__ directive .global and multiple .symver not supported mathieu.malaterre at gmail dot com
                   ` (4 preceding siblings ...)
  2022-02-03 11:19 ` pinskia at gcc dot gnu.org
@ 2022-02-03 17:13 ` danglin at gcc dot gnu.org
  2022-02-03 17:32 ` dave.anglin at bell dot net
                   ` (4 subsequent siblings)
  10 siblings, 0 replies; 12+ messages in thread
From: danglin at gcc dot gnu.org @ 2022-02-03 17:13 UTC (permalink / raw)
  To: gcc-bugs

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=104363

John David Anglin <danglin at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |danglin at gcc dot gnu.org

--- Comment #6 from John David Anglin <danglin at gcc dot gnu.org> ---
For context, see:
https://github.com/smuellerDD/libkcapi/issues/133#issuecomment-1024349323

Note that the following commit fixes the symbol issue on hppa with gcc-11:
https://github.com/smuellerDD/libkcapi/commit/71d80bcffca26373149121e026d612146b4695d5

The patch predates the hppa issue and it doesn't have anything to do
with hppa.  It does mention -flto but this doesn't seem to apply here.

As far as I remember, support for symbol versioning is done in generic code.

If I was to guess, I suspect the problem is with asm.  Maybe a '\t'
is needed before .symver on hppa.  The hppa assembler wants white space
before directives.

^ permalink raw reply	[flat|nested] 12+ messages in thread

* [Bug target/104363] hppa: __asm__ directive .global and multiple .symver not supported
  2022-02-03  9:34 [Bug c/104363] New: hppa: __asm__ directive .global and multiple .symver not supported mathieu.malaterre at gmail dot com
                   ` (5 preceding siblings ...)
  2022-02-03 17:13 ` danglin at gcc dot gnu.org
@ 2022-02-03 17:32 ` dave.anglin at bell dot net
  2022-02-07  8:18 ` mathieu.malaterre at gmail dot com
                   ` (3 subsequent siblings)
  10 siblings, 0 replies; 12+ messages in thread
From: dave.anglin at bell dot net @ 2022-02-03 17:32 UTC (permalink / raw)
  To: gcc-bugs

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=104363

--- Comment #7 from dave.anglin at bell dot net ---
On 2022-02-03 12:13 p.m., danglin at gcc dot gnu.org wrote:
> If I was to guess, I suspect the problem is with asm.  Maybe a '\t'
> is needed before .symver on hppa.  The hppa assembler wants white space
> before directives.
That is fixed in this commit:
https://github.com/smuellerDD/libkcapi/commit/3e9a1494dd2401094675fb54b1013022bd7933b8

^ permalink raw reply	[flat|nested] 12+ messages in thread

* [Bug target/104363] hppa: __asm__ directive .global and multiple .symver not supported
  2022-02-03  9:34 [Bug c/104363] New: hppa: __asm__ directive .global and multiple .symver not supported mathieu.malaterre at gmail dot com
                   ` (6 preceding siblings ...)
  2022-02-03 17:32 ` dave.anglin at bell dot net
@ 2022-02-07  8:18 ` mathieu.malaterre at gmail dot com
  2022-02-07  8:20 ` mathieu.malaterre at gmail dot com
                   ` (2 subsequent siblings)
  10 siblings, 0 replies; 12+ messages in thread
From: mathieu.malaterre at gmail dot com @ 2022-02-07  8:18 UTC (permalink / raw)
  To: gcc-bugs

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=104363

--- Comment #8 from Mathieu Malaterre <mathieu.malaterre at gmail dot com> ---
Dear John,

(In reply to John David Anglin from comment #6)
> For context, see:
> https://github.com/smuellerDD/libkcapi/issues/133#issuecomment-1024349323
> 
> Note that the following commit fixes the symbol issue on hppa with gcc-11:
> https://github.com/smuellerDD/libkcapi/commit/
> 71d80bcffca26373149121e026d612146b4695d5

As mentionned in the commit message, this is an alternate solution (use of
gcc-10 new attribute for `symver`).

> The patch predates the hppa issue and it doesn't have anything to do
> with hppa.  It does mention -flto but this doesn't seem to apply here.

Use of -flto seems to confict with the use of asm .symver directive, which is
solved by using gcc attribute.

> As far as I remember, support for symbol versioning is done in generic code.
> 
> If I was to guess, I suspect the problem is with asm.  Maybe a '\t'
> is needed before .symver on hppa.  The hppa assembler wants white space
> before directives.

That would not explain the regression gcc-10 -> gcc-11 AFAIK.

^ permalink raw reply	[flat|nested] 12+ messages in thread

* [Bug target/104363] hppa: __asm__ directive .global and multiple .symver not supported
  2022-02-03  9:34 [Bug c/104363] New: hppa: __asm__ directive .global and multiple .symver not supported mathieu.malaterre at gmail dot com
                   ` (7 preceding siblings ...)
  2022-02-07  8:18 ` mathieu.malaterre at gmail dot com
@ 2022-02-07  8:20 ` mathieu.malaterre at gmail dot com
  2022-02-22  9:15 ` mathieu.malaterre at gmail dot com
  2022-02-22 14:42 ` dave.anglin at bell dot net
  10 siblings, 0 replies; 12+ messages in thread
From: mathieu.malaterre at gmail dot com @ 2022-02-07  8:20 UTC (permalink / raw)
  To: gcc-bugs

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=104363

--- Comment #9 from Mathieu Malaterre <mathieu.malaterre at gmail dot com> ---
(In reply to Andrew Pinski from comment #5)
> (In reply to Mathieu Malaterre from comment #2)
> > I've downgraded binutils to version from bullseye, and I am getting the
> > exact same symptoms:
> 
> Did you build from scratch or reuse the object files?

Everything was done using a fresh tarball export.

^ permalink raw reply	[flat|nested] 12+ messages in thread

* [Bug target/104363] hppa: __asm__ directive .global and multiple .symver not supported
  2022-02-03  9:34 [Bug c/104363] New: hppa: __asm__ directive .global and multiple .symver not supported mathieu.malaterre at gmail dot com
                   ` (8 preceding siblings ...)
  2022-02-07  8:20 ` mathieu.malaterre at gmail dot com
@ 2022-02-22  9:15 ` mathieu.malaterre at gmail dot com
  2022-02-22 14:42 ` dave.anglin at bell dot net
  10 siblings, 0 replies; 12+ messages in thread
From: mathieu.malaterre at gmail dot com @ 2022-02-22  9:15 UTC (permalink / raw)
  To: gcc-bugs

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=104363

Mathieu Malaterre <mathieu.malaterre at gmail dot com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|WAITING                     |RESOLVED
         Resolution|---                         |INVALID

--- Comment #10 from Mathieu Malaterre <mathieu.malaterre at gmail dot com> ---
This is not a regression, I can reproduce the exact same error using gcc-10:

[...]
libkcapi-1.3.1/apps/kcapi-rng.c:302: undefined reference to
`kcapi_rng_generate'
/usr/lib/gcc-cross/hppa-linux-gnu/10/../../../../hppa-linux-gnu/bin/ld:
libkcapi-1.3.1/apps/kcapi-rng.c:328: undefined reference to
`kcapi_memset_secure'
[...]


Closing as invalid.

^ permalink raw reply	[flat|nested] 12+ messages in thread

* [Bug target/104363] hppa: __asm__ directive .global and multiple .symver not supported
  2022-02-03  9:34 [Bug c/104363] New: hppa: __asm__ directive .global and multiple .symver not supported mathieu.malaterre at gmail dot com
                   ` (9 preceding siblings ...)
  2022-02-22  9:15 ` mathieu.malaterre at gmail dot com
@ 2022-02-22 14:42 ` dave.anglin at bell dot net
  10 siblings, 0 replies; 12+ messages in thread
From: dave.anglin at bell dot net @ 2022-02-22 14:42 UTC (permalink / raw)
  To: gcc-bugs

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=104363

--- Comment #11 from dave.anglin at bell dot net ---
On 2022-02-22 4:15 a.m., mathieu.malaterre at gmail dot com wrote:
> [...]
> libkcapi-1.3.1/apps/kcapi-rng.c:302: undefined reference to
> `kcapi_rng_generate'
> /usr/lib/gcc-cross/hppa-linux-gnu/10/../../../../hppa-linux-gnu/bin/ld:
> libkcapi-1.3.1/apps/kcapi-rng.c:328: undefined reference to
> `kcapi_memset_secure'
> [...]
As I tried to say previously, the problem was with the asm used in libkcapi.

^ permalink raw reply	[flat|nested] 12+ messages in thread

end of thread, other threads:[~2022-02-22 14:42 UTC | newest]

Thread overview: 12+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-02-03  9:34 [Bug c/104363] New: hppa: __asm__ directive .global and multiple .symver not supported mathieu.malaterre at gmail dot com
2022-02-03  9:38 ` [Bug target/104363] " pinskia at gcc dot gnu.org
2022-02-03  9:45 ` mathieu.malaterre at gmail dot com
2022-02-03  9:47 ` mathieu.malaterre at gmail dot com
2022-02-03 11:18 ` pinskia at gcc dot gnu.org
2022-02-03 11:19 ` pinskia at gcc dot gnu.org
2022-02-03 17:13 ` danglin at gcc dot gnu.org
2022-02-03 17:32 ` dave.anglin at bell dot net
2022-02-07  8:18 ` mathieu.malaterre at gmail dot com
2022-02-07  8:20 ` mathieu.malaterre at gmail dot com
2022-02-22  9:15 ` mathieu.malaterre at gmail dot com
2022-02-22 14:42 ` dave.anglin at bell dot net

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).