Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 775278 - sys-auth/oath-toolkit-2.6.2 pam_oath.c:346:8: error: variable '_pam_oath_modstruct' has initializer but incomplete type
Summary: sys-auth/oath-toolkit-2.6.2 pam_oath.c:346:8: error: variable '_pam_oath_mods...
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Current packages (show other bugs)
Hardware: All Linux
: Normal normal (vote)
Assignee: Robin Johnson
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2021-03-10 17:27 UTC by Alessandro Barbieri
Modified: 2023-03-05 12:37 UTC (History)
2 users (show)

See Also:
Package list:
Runtime testing required: ---


Attachments
oath-toolkit-2.6.2:20210310-161542.log (oath-toolkit-2.6.2:20210310-161542.log,335.25 KB, text/plain)
2021-03-10 17:27 UTC, Alessandro Barbieri
Details
successful build.log + emerge --info.txt (successful-build.log-emerge-info.txt,359.58 KB, text/plain)
2021-03-11 04:56 UTC, Ionen Wolkens
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Alessandro Barbieri 2021-03-10 17:27:29 UTC
doesn't build with either slibtoo, libtool, bash, dash, lld, bfd, gnubinutils and llvmbinutils

make[4]: Entering directory '/var/tmp/portage/sys-auth/oath-toolkit-2.6.2/work/oath-toolkit-2.6.2/pam_oath'                                                                                              [11/10976]
slibtool  --tag=CC   --mode=compile x86_64-pc-linux-gnu-gcc -DHAVE_CONFIG_H -I.  -I./../liboath   -Os -pipe -march=native -Os -pipe -march=native -Wimplicit-function-declaration -Wno-error=implicit-function-decl
aration -c -o pam_oath.lo pam_oath.c
slibtool: compile: x86_64-pc-linux-gnu-gcc -DHAVE_CONFIG_H -I. -I./../liboath -Os -pipe -march=native -Os -pipe -march=native -Wimplicit-function-declaration -Wno-error=implicit-function-declaration -c pam_oath.
c -DPIC -fPIC -o .libs/pam_oath.o                                                                        
slibtool: compile: x86_64-pc-linux-gnu-gcc -DHAVE_CONFIG_H -I. -I./../liboath -Os -pipe -march=native -Os -pipe -march=native -Wimplicit-function-declaration -Wno-error=implicit-function-declaration -c pam_oath.
c -o pam_oath.o                                                                                                                                                                                                    
pam_oath.c:346:8: error: variable '_pam_oath_modstruct' has initializer but incomplete type                                                                                                                        
  346 | struct pam_module _pam_oath_modstruct = {                                                                                                                                                                  
      |        ^~~~~~~~~~                                                                                
pam_oath.c:347:3: warning: excess elements in struct initializer            
  347 |   "pam_oath",                                                                                                                                                                                              
      |   ^~~~~~~~~~ 
pam_oath.c:347:3: note: (near initialization for '_pam_oath_modstruct')
pam_oath.c:348:3: warning: excess elements in struct initializer
  348 |   pam_sm_authenticate,
      |   ^~~~~~~~~~~~~~~~~~~
pam_oath.c:348:3: note: (near initialization for '_pam_oath_modstruct')
pam_oath.c:349:3: warning: excess elements in struct initializer
  349 |   pam_sm_setcred,
      |   ^~~~~~~~~~~~~~
pam_oath.c:349:3: note: (near initialization for '_pam_oath_modstruct')
pam_oath.c:350:3: warning: excess elements in struct initializer
  350 |   NULL,
      |   ^~~~
pam_oath.c:350:3: note: (near initialization for '_pam_oath_modstruct')
pam_oath.c:351:3: warning: excess elements in struct initializer
  351 |   NULL,
      |   ^~~~
pam_oath.c:351:3: note: (near initialization for '_pam_oath_modstruct')
pam_oath.c:352:3: warning: excess elements in struct initializer
  352 |   NULL,
      |   ^~~~
pam_oath.c:352:3: note: (near initialization for '_pam_oath_modstruct')
pam_oath.c:353:3: warning: excess elements in struct initializer
  353 |   NULL
      |   ^~~~
pam_oath.c:353:3: note: (near initialization for '_pam_oath_modstruct')
pam_oath.c:346:19: error: storage size of '_pam_oath_modstruct' isn't known
  346 | struct pam_module _pam_oath_modstruct = {
      |                   ^~~~~~~~~~~~~~~~~~~
slibtool: error logged in slbt_exec_compile(), line 234: Success.
make[4]: *** [Makefile:549: pam_oath.lo] Error 2
make[4]: Leaving directory '/var/tmp/portage/sys-auth/oath-toolkit-2.6.2/work/oath-toolkit-2.6.2/pam_oath'
make[3]: *** [Makefile:567: all-recursive] Error 1
make[3]: Leaving directory '/var/tmp/portage/sys-auth/oath-toolkit-2.6.2/work/oath-toolkit-2.6.2/pam_oath'
make[2]: *** [Makefile:425: all] Error 2
make[2]: Leaving directory '/var/tmp/portage/sys-auth/oath-toolkit-2.6.2/work/oath-toolkit-2.6.2/pam_oath'
make[1]: *** [Makefile:404: all-recursive] Error 1
make[1]: Leaving directory '/var/tmp/portage/sys-auth/oath-toolkit-2.6.2/work/oath-toolkit-2.6.2'
make: *** [Makefile:360: all] Error 2
 * ERROR: sys-auth/oath-toolkit-2.6.2::gentoo failed (compile phase):
Comment 1 Alessandro Barbieri 2021-03-10 17:27:57 UTC
Created attachment 690534 [details]
oath-toolkit-2.6.2:20210310-161542.log

buildlog
Comment 2 Ionen Wolkens gentoo-dev 2021-03-11 03:09:08 UTC
Seems to happen when -DPIC isn't set:

/* Libtool defines PIC for shared objects */
#ifndef PIC
#define PAM_STATIC
#endif
[...]
#ifdef PAM_STATIC
struct pam_module _pam_oath_modstruct = {

(In reply to Alessandro Barbieri from comment #0)
> doesn't build with either slibtoo, libtool, bash, dash, lld, bfd,
> gnubinutils and llvmbinutils
However I can't seem to reproduce, I tried libtool/rlibtool/clang/lld/bfd and all seems fine, e.g. one of my pam_oath line is:

    rlibtool: compile: x86_64-pc-linux-gnu-clang -DHAVE_CONFIG_H -I. -I./../liboath -march=native -O2 -pipe -fdiagnostics-color=always -frecord-gcc-switches -c pam_oath.c -DPIC -fPIC -o .libs/pam_oath.o

While yours lacks -DPIC:

    slibtool: compile: x86_64-pc-linux-gnu-gcc -DHAVE_CONFIG_H -I. -I./../liboath -Os -pipe -march=native -Os -pipe -march=native -Wimplicit-function-declaration -Wno-error=implicit-function-declaration -c pam_oath.c -o pam_oath.o

Didn't look further. If I were to guess it may be something bashrc-mv is doing (I don't use it).
Comment 3 Alessandro Barbieri 2021-03-11 04:26:35 UTC
You are comparing two different lines: I have -DPIC while building .libs/pam_oath.o (like yours) and it lacks the following line

libtool: compile:  x86_64-pc-linux-gnu-gcc -DHAVE_CONFIG_H -I. -I./../liboath -Os -pipe -march=native -Os -pipe -march=native -Wimplicit-function-declaration -Wno-error=implicit-function-declaration -c pam_oath.c  -fPIC -DPIC -o.libs/pam_oath.o
libtool: compile:  x86_64-pc-linux-gnu-gcc -DHAVE_CONFIG_H -I. -I./../liboath -Os -pipe -march=native -Os -pipe -march=native -Wimplicit-function-declaration -Wno-error=implicit-function-declaration -c pam_oath.c -o pam_oath.o >/dev/null 2>&1
Comment 4 Ionen Wolkens gentoo-dev 2021-03-11 04:56:21 UTC
Created attachment 690615 [details]
successful build.log + emerge --info.txt

And that's interesting because I don't have a line with '-o pam_oath.o' without .libs. Looks like it's compiling the same .c twice for you, and the second time there's no -DPIC causing the error.

Attaching my own log to compare.
Comment 5 Ionen Wolkens gentoo-dev 2021-03-14 05:02:12 UTC
Had another quick look at this given other bugs indicate you use MAKE='make LIBTOOL=libtool' even for GNU libtool.

fails: MAKE='make LIBTOOL=libtool'
fails: MAKE='make LIBTOOL=slibtool'
fails: MAKEFLAGS='LIBTOOL=libtool/slibtool'
works: MAKEFLAGS='LIBTOOL=rlibtool'
works: setting nothing

The last two is what I typically use to test slibtool + normal libtool.

So, seems rlibtool works over slibtool, and GNU libtool only fails if LIBTOOL is set.
Comment 6 Alessandro Barbieri 2021-03-14 15:04:49 UTC
I've tried again with libtool but it's using slibtool instead ...
Comment 7 Larry the Git Cow gentoo-dev 2023-03-05 12:37:41 UTC
The bug has been closed via the following commit(s):

https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=93b66e313c8f85be009ac2c6ee3a70938ee49058

commit 93b66e313c8f85be009ac2c6ee3a70938ee49058
Author:     Sam James <sam@gentoo.org>
AuthorDate: 2023-03-05 12:35:32 +0000
Commit:     Sam James <sam@gentoo.org>
CommitDate: 2023-03-05 12:37:22 +0000

    sys-auth/oath-toolkit: add 2.6.7
    
    Bug: https://bugs.gentoo.org/719314
    Closes: https://bugs.gentoo.org/683864
    Closes: https://bugs.gentoo.org/719310
    Closes: https://bugs.gentoo.org/775278
    Closes: https://bugs.gentoo.org/827887
    Closes: https://bugs.gentoo.org/837791
    Closes: https://bugs.gentoo.org/898740
    Signed-off-by: Sam James <sam@gentoo.org>

 sys-auth/oath-toolkit/Manifest                     |  1 +
 .../oath-toolkit-2.6.7-new-xmlsec-tests.patch      | 74 ++++++++++++++++++++++
 sys-auth/oath-toolkit/oath-toolkit-2.6.7.ebuild    | 74 ++++++++++++++++++++++
 3 files changed, 149 insertions(+)