Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 918992 - sys-kernel/linux-headers struct termio from arch/sparc/include/uapi/asm/termbits.h conflicts with bits/ioctl-types.h from sys-libs/glibc (was: net-dialup/ppp-2.5.0-r3: fails to compile with error: redefinition of ‘struct termio’)
Summary: sys-kernel/linux-headers struct termio from arch/sparc/include/uapi/asm/termb...
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Current packages (show other bugs)
Hardware: Sparc64 Linux
: Normal normal (vote)
Assignee: Gentoo Toolchain Maintainers
URL:
Whiteboard:
Keywords: PullRequest
Depends on:
Blocks: 914547
  Show dependency tree
 
Reported: 2023-12-02 00:20 UTC by 2857
Modified: 2024-03-27 00:08 UTC (History)
3 users (show)

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


Attachments
emerge --info (file_918992.txt,5.92 KB, text/plain)
2023-12-02 00:21 UTC, 2857
Details
emerge -pqv '=net-dialup/ppp-2.5.0-r3::gentoo' (file_918992.txt,201 bytes, text/plain)
2023-12-02 00:22 UTC, 2857
Details
build.log (file_918992.txt,21.67 KB, text/plain)
2023-12-02 00:27 UTC, 2857
Details
proposed patch from buildroot (file_918992.txt,422 bytes, patch)
2023-12-02 01:21 UTC, 2857
Details | Diff
patch for linux-headers (0001-sparc-move-struct-termio-from-asm-termbits.h-to-asm-.patch,2.07 KB, patch)
2024-03-06 04:26 UTC, Mike Gilbert
Details | Diff
patch for linux-headers v2 (0001-sparc-move-struct-termio-to-asm-termios.h.patch,2.05 KB, patch)
2024-03-06 04:56 UTC, Mike Gilbert
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description 2857 2023-12-02 00:20:35 UTC
Stable sparc64 system, emerging ppp from the main tree. Fix appears to be to redefine struct termios as asmtermios: https://patchwork.ozlabs.org/project/buildroot/patch/20190723085516.17377-1-vadim4j@gmail.com

Reproducible: Always
Comment 1 2857 2023-12-02 00:21:18 UTC
Created attachment 876273 [details]
emerge --info
Comment 2 2857 2023-12-02 00:22:34 UTC
Created attachment 876274 [details]
emerge -pqv '=net-dialup/ppp-2.5.0-r3::gentoo'
Comment 3 2857 2023-12-02 00:27:11 UTC
Created attachment 876275 [details]
build.log
Comment 4 2857 2023-12-02 00:33:18 UTC
Correction: it seems that ppp already aware of this namespace conflict, but for some reason the macro which redefines termios is not triggered: pppd/termios_linux.h
Comment 5 2857 2023-12-02 00:49:31 UTC
There's more. Apparently it's a well known longstanding bug in ppp, which everyone fixes as they could... buildroot straight up disabled ppp on sparc64 due to that, rejecting this patch: http://patchwork.ozlabs.org/project/buildroot/patch/20191227204520.1500501-1-fontaine.fabrice@gmail.com/

picocom decided to reimplemented struct in question: https://github.com/npat-efault/picocom/blob/master/termbits2.h#L37

I worked around the issue by applying buildroot patch. Seems to be safe, if one only applies it for sparc64?
Comment 6 2857 2023-12-02 01:21:57 UTC
Created attachment 876278 [details, diff]
proposed patch from buildroot
Comment 7 Andreas K. Hüttel archtester gentoo-dev 2023-12-26 14:56:42 UTC
This makes release media build fail.

sparc64/installcd-stage1.spec log:

[32m * [39;49;00mPackage:    net-dialup/ppp-2.5.0-r3:0/2.5.0
[32m * [39;49;00mRepository: gentoo
[32m * [39;49;00mMaintainer: base-system@gentoo.org
[32m * [39;49;00mUSE:        elibc_glibc kernel_linux pam sparc
[32m * [39;49;00mFEATURES:   network-sandbox preserve-libs sandbox userpriv usersandbox
 [32m*[0m Determining the location of the kernel source code
 [33;01m*[0m Unable to find kernel sources at /usr/src/linux
 [32m*[0m Please make sure that /usr/src/linux points at your running kernel, 
 [32m*[0m (or the kernel you wish to build against).
 [32m*[0m Alternatively, set the KERNEL_DIR environment variable to the kernel sources location
 [33;01m*[0m Unable to calculate Linux Kernel version for build, attempting to use running version
 [32m*[0m Checking for suitable kernel configuration options ...
 [31;01m*[0m   CONFIG_PPP:     missing PPP support (REQUIRED)
 [31;01m*[0m   CONFIG_PPP_ASYNC:       missing asynchronous serial line discipline (optional, but highly recommended)
 [33;01m*[0m   CONFIG_PPP_SYNC_TTY:    missing synchronous serial line discipline (optional; used by 'sync' pppd option)
 [31;01m*[0m   CONFIG_PPP_DEFLATE:     missing Deflate compression (optional, but highly recommended)
 [31;01m*[0m   CONFIG_PPP_BSDCOMP:     missing BSD-Compress compression (optional, but highly recommended)
 [33;01m*[0m   CONFIG_PPP_MPPE:        missing MPPE encryption (optional, mostly used by PPTP links)
 [33;01m*[0m   CONFIG_PPPOE:   missing PPPoE support (optional, needed by pppoe plugin)
[A[72C [34;01m[ [31;01m!![34;01m ][0m
 [33;01m*[0m Please check to make sure these options are set correctly.
 [33;01m*[0m Failure to do so may cause unexpected problems.
 [32m*[0m Applying ppp-2.5.0-passwordfd-read-early.patch ...
[A[72C [34;01m[ [32;01mok[34;01m ][0m
 [32m*[0m Applying ppp-2.5.0-pidfile.patch ...
[A[72C [34;01m[ [32;01mok[34;01m ][0m
checking whether make supports nested variables... yes
checking for a BSD-compatible install... /usr/lib/portage/python3.11/ebuild-helpers/xattr/install -c
checking whether build environment is sane... yes
checking for a race-free mkdir -p... /bin/mkdir -p
checking for gawk... gawk
checking whether make sets $(MAKE)... yes
checking whether to enable maintainer-specific portions of Makefiles... yes
checking for sparc64-unknown-linux-gnu-gcc... sparc64-unknown-linux-gnu-gcc
checking whether the C compiler works... yes
checking for C compiler default output file name... a.out
checking for suffix of executables... 
checking whether we are cross compiling... no
checking for suffix of object files... o
checking whether the compiler supports GNU C... yes
checking whether sparc64-unknown-linux-gnu-gcc accepts -g... yes
checking for sparc64-unknown-linux-gnu-gcc option to enable C11 features... none needed
checking whether sparc64-unknown-linux-gnu-gcc understands -c and -o together... yes
checking whether make supports the include directive... yes (GNU style)
checking dependency style of sparc64-unknown-linux-gnu-gcc... none
checking whether ln -s works... yes
checking build system type... sparc64-unknown-linux-gnu
checking host system type... sparc64-unknown-linux-gnu
checking how to print strings... printf
checking for a sed that does not truncate output... /bin/sed
checking for grep that handles long lines and -e... /bin/grep
checking for egrep... /bin/grep -E
checking for fgrep... /bin/grep -F
checking for ld used by sparc64-unknown-linux-gnu-gcc... /usr/sparc64-unknown-linux-gnu/bin/ld
checking if the linker (/usr/sparc64-unknown-linux-gnu/bin/ld) is GNU ld... yes
checking for BSD- or MS-compatible name lister (nm)... /usr/bin/sparc64-unknown-linux-gnu-nm -B
checking the name lister (/usr/bin/sparc64-unknown-linux-gnu-nm -B) interface... BSD nm
checking the maximum length of command line arguments... 1572864
checking how to convert sparc64-unknown-linux-gnu file names to sparc64-unknown-linux-gnu format... func_convert_file_noop
checking how to convert sparc64-unknown-linux-gnu file names to toolchain format... func_convert_file_noop
checking for /usr/sparc64-unknown-linux-gnu/bin/ld option to reload object files... -r
checking for sparc64-unknown-linux-gnu-file... no
checking for file... file
checking for sparc64-unknown-linux-gnu-objdump... sparc64-unknown-linux-gnu-objdump
checking how to recognize dependent libraries... pass_all
checking for sparc64-unknown-linux-gnu-dlltool... no
checking for dlltool... no
checking how to associate runtime and link libraries... printf %s

checking for sparc64-unknown-linux-gnu-ar... sparc64-unknown-linux-gnu-ar
checking for archiver @FILE support... @
checking for sparc64-unknown-linux-gnu-strip... sparc64-unknown-linux-gnu-strip
checking for sparc64-unknown-linux-gnu-ranlib... sparc64-unknown-linux-gnu-ranlib
checking command to parse /usr/bin/sparc64-unknown-linux-gnu-nm -B output from sparc64-unknown-linux-gnu-gcc object... ok
checking for sysroot... /
checking for a working dd... /bin/dd
checking how to truncate binary pipes... /bin/dd bs=4096 count=1
checking for sparc64-unknown-linux-gnu-mt... no
checking for mt... no
checking if : is a manifest tool... no
checking for stdio.h... yes
checking for stdlib.h... yes
checking for string.h... yes
checking for inttypes.h... yes
checking for stdint.h... yes
checking for strings.h... yes
checking for sys/stat.h... yes
checking for sys/types.h... yes
checking for unistd.h... yes
checking for dlfcn.h... yes
checking for objdir... .libs
checking if sparc64-unknown-linux-gnu-gcc supports -fno-rtti -fno-exceptions... no
checking for sparc64-unknown-linux-gnu-gcc option to produce PIC... -fPIC -DPIC
checking if sparc64-unknown-linux-gnu-gcc PIC flag -fPIC -DPIC works... yes
checking if sparc64-unknown-linux-gnu-gcc static flag -static works... yes
checking if sparc64-unknown-linux-gnu-gcc supports -c -o file.o... yes
checking if sparc64-unknown-linux-gnu-gcc supports -c -o file.o... (cached) yes
checking whether the sparc64-unknown-linux-gnu-gcc linker (/usr/sparc64-unknown-linux-gnu/bin/ld -m elf64_sparc) supports shared libraries... yes
checking whether -lc should be explicitly linked in... no
checking dynamic linker characteristics... GNU/Linux ld.so
checking how to hardcode library paths into programs... immediate
checking whether stripping libraries is possible... yes
checking if libtool supports shared libraries... yes
checking whether to build shared libraries... yes
checking whether to build static libraries... no
checking for sparc64-unknown-linux-gnu-pkg-config... /usr/bin/sparc64-unknown-linux-gnu-pkg-config
checking pkg-config is at least version 0.9.0... yes
checking for _Bool... yes
checking for stdbool.h that conforms to C99... yes
checking for asm/types.h... yes
checking for crypt.h... yes
checking for paths.h... yes
checking for shadow.h... yes
checking for stddef.h... yes
checking for stdarg.h... yes
checking for sys/dlpi.h... no
checking for sys/ioctl.h... yes
checking for sys/socket.h... yes
checking for sys/time.h... yes
checking for sys/uio.h... yes
checking for time.h... yes
checking for unistd.h... (cached) yes
checking for utmp.h... yes
checking for net/bpf.h... no
checking for net/if.h... yes
checking for net/if_types.h... no
checking for net/if_arp.h... yes
checking for linux/if.h... yes
checking for linux/if_ether.h... yes
checking for linux/if_packet.h... yes
checking for netinet/if_ether.h... yes
checking for netpacket/packet.h... yes
checking size of unsigned int... 4
checking size of unsigned long... 8
checking size of unsigned short... 2
checking for mmap... yes
checking for logwtmp... yes
checking for strerror... yes
checking for crypt in -lcrypt... yes
checking for openssl/ssl.h in /usr/local/ssl... no
checking for openssl/ssl.h in /usr/lib/ssl... no
checking for openssl/ssl.h in /usr/ssl... no
checking for openssl/ssl.h in /usr/pkg... no
checking for openssl/ssl.h in /usr/local... no
checking for openssl/ssl.h in /usr... yes
checking whether compiling and linking against OpenSSL works... yes
checking how to run the C preprocessor... sparc64-unknown-linux-gnu-gcc -E
checking for md4 support in openssl... yes
checking for md5 support in openssl... yes
checking for des support in openssl... yes
checking for sha support in openssl... yes
checking if compiling and linking against libsrp works... no
checking for pam_appl.h in /usr/local... no
checking for pam_appl.h in /usr/lib... no
checking for pam_appl.h in /usr... yes
checking if compiling and linking against libpam works... yes
checking that generated files are newer than configure... done
configure: creating ./config.status
config.status: creating Makefile
config.status: creating chat/Makefile
config.status: creating contrib/Makefile
config.status: creating contrib/pppgetpass/Makefile
config.status: creating common/Makefile
config.status: creating include/Makefile
config.status: creating modules/Makefile
config.status: creating pppd/Makefile
config.status: creating pppd/pppd.pc
config.status: creating pppd/plugins/Makefile
config.status: creating pppd/plugins/pppoe/Makefile
config.status: creating pppd/plugins/pppoatm/Makefile
config.status: creating pppd/plugins/pppol2tp/Makefile
config.status: creating pppd/plugins/radius/Makefile
config.status: creating pppdump/Makefile
config.status: creating pppstats/Makefile
config.status: creating scripts/Makefile
config.status: creating pppd/config.h
config.status: creating pppd/pppdconf.h
config.status: creating pppd/plugins/pppoe/config.h
config.status: executing depfiles commands
config.status: executing libtool commands

ppp version 2.5.0
    Prefix...............: /usr
    Runtime Dir..........: /run/pppd
    Logfile Dir..........: /var/log/ppp
    Plugin Dir...........: /usr/lib64/pppd/2.5.0
    System CA Path ......: /etc/ssl/certs
    With OpenSSL.........: yes
    With libatm..........: no
    With libpam..........: yes
    With libpcap.........: no
    With libsrp..........: no
    C Compiler...........: sparc64-unknown-linux-gnu-gcc -O2 -mcpu=ultrasparc -pipe
    Linker...............: /usr/sparc64-unknown-linux-gnu/bin/ld -m elf64_sparc -Wl,-O1 -Wl,--as-needed 

Features enabled
    Microsoft Extensions.: yes
    Multilink............: no
    Plugins..............: yes
    CBCP.................: yes
    IPV6CP...............: yes
    EAP-TLS..............: yes
    PEAP.................: yes
    systemd notifications: no

Making all in chat
make[1]: Entering directory '/var/tmp/portage/net-dialup/ppp-2.5.0-r3/work/ppp-2.5.0/chat'

[...]

/bin/sh ../libtool  --tag=CC   --mode=compile sparc64-unknown-linux-gnu-gcc -DHAVE_CONFIG_H -I. -I../pppd/plugins/pppoe  -I/usr/include   -O2 -mcpu=ultrasparc -pipe -c -o libppp_crypto_la-ppp-md4.lo `test -f 'ppp-md4.c' || echo './'`ppp-md4.c
/bin/sh ../libtool  --tag=CC   --mode=compile sparc64-unknown-linux-gnu-gcc -DHAVE_CONFIG_H -I. -I../pppd/plugins/pppoe  -I/usr/include   -O2 -mcpu=ultrasparc -pipe -c -o libppp_crypto_la-ppp-sha1.lo `test -f 'ppp-sha1.c' || echo './'`ppp-sha1.c
/bin/sh ../libtool  --tag=CC   --mode=compile sparc64-unknown-linux-gnu-gcc -DHAVE_CONFIG_H -I. -I../pppd/plugins/pppoe  -I/usr/include   -O2 -mcpu=ultrasparc -pipe -c -o libppp_crypto_la-ppp-des.lo `test -f 'ppp-des.c' || echo './'`ppp-des.c
libtool: compile:  sparc64-unknown-linux-gnu-gcc -DHAVE_CONFIG_H -I. -I../pppd/plugins/pppoe -I/usr/include -O2 -mcpu=ultrasparc -pipe -c ppp-sha1.c  -fPIC -DPIC -o .libs/libppp_crypto_la-ppp-sha1.o
libtool: compile:  sparc64-unknown-linux-gnu-gcc -DHAVE_CONFIG_H -I. -I../pppd/plugins/pppoe -I/usr/include -O2 -mcpu=ultrasparc -pipe -c crypto.c  -fPIC -DPIC -o .libs/libppp_crypto_la-crypto.o
In file included from termios_linux.h:35,
                 from sys-linux.c:186:
/usr/include/asm/termbits.h:14:8: error: redefinition of ‘struct termio’
   14 | struct termio {
      |        ^~~~~~
In file included from /usr/include/sys/ioctl.h:29,
                 from sys-linux.c:76:
/usr/include/bits/ioctl-types.h:36:8: note: originally defined here
   36 | struct termio
      |        ^~~~~~
libtool: compile:  sparc64-unknown-linux-gnu-gcc -DHAVE_CONFIG_H -I. -I../pppd/plugins/pppoe -I/usr/include -O2 -mcpu=ultrasparc -pipe -c ppp-md5.c  -fPIC -DPIC -o .libs/libppp_crypto_la-ppp-md5.o
libtool: compile:  sparc64-unknown-linux-gnu-gcc -DHAVE_CONFIG_H -I. -I../pppd/plugins/pppoe -I/usr/include -O2 -mcpu=ultrasparc -pipe -c ppp-md4.c  -fPIC -DPIC -o .libs/libppp_crypto_la-ppp-md4.o
libtool: compile:  sparc64-unknown-linux-gnu-gcc -DHAVE_CONFIG_H -I. -I../pppd/plugins/pppoe -I/usr/include -O2 -mcpu=ultrasparc -pipe -c ppp-des.c  -fPIC -DPIC -o .libs/libppp_crypto_la-ppp-des.o
make[2]: *** [Makefile:1315: pppd-sys-linux.o] Error 1
make[2]: *** Waiting for unfinished jobs....
eap-tls.c: In function ‘eaptls_ssl_load_config’:
eap-tls.c:172:5: warning: ‘ENGINE_load_builtin_engines’ is deprecated: Since OpenSSL 3.0 [-Wdeprecated-declarations]
  172 |     ENGINE_load_builtin_engines();
      |     ^~~~~~~~~~~~~~~~~~~~~~~~~~~
In file included from eap-tls.c:45:
/usr/include/openssl/engine.h:358:28: note: declared here
  358 | OSSL_DEPRECATEDIN_3_0 void ENGINE_load_builtin_engines(void);
      |                            ^~~~~~~~~~~~~~~~~~~~~~~~~~~
eap-tls.c: In function ‘eaptls_ssl_load_engine’:
eap-tls.c:193:5: warning: ‘ENGINE_register_all_complete’ is deprecated: Since OpenSSL 3.0 [-Wdeprecated-declarations]
  193 |     ENGINE_register_all_complete();
      |     ^~~~~~~~~~~~~~~~~~~~~~~~~~~~
Comment 8 Larry the Git Cow gentoo-dev 2024-02-19 15:25:32 UTC
The bug has been referenced in the following commit(s):

https://gitweb.gentoo.org/proj/releng.git/commit/?id=8044b32eec32e948fa67d13cc05673f9dd0a6d74

commit 8044b32eec32e948fa67d13cc05673f9dd0a6d74
Author:     Ben Kohler <bkohler@gentoo.org>
AuthorDate: 2024-02-19 15:24:23 +0000
Commit:     Ben Kohler <bkohler@gentoo.org>
CommitDate: 2024-02-19 15:24:23 +0000

    specs/sparc: remove rp-pppoe (& ppp)
    
    net-dialup/ppp hasn't built on sparc for a while and it's a pretty messy
    bug #918992.  Let's just remove it for now to keep isos building.
    
    Bug: https://bugs.gentoo.org/918992
    
    Signed-off-by: Ben Kohler <bkohler@gentoo.org>

 releases/specs/sparc/sparc64/installcd-stage1.spec | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
Comment 9 Larry the Git Cow gentoo-dev 2024-03-05 19:57:57 UTC
The bug has been referenced in the following commit(s):

https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=95ec382366f185207e825453dd032e1f1f3e084d

commit 95ec382366f185207e825453dd032e1f1f3e084d
Author:     Mike Gilbert <floppym@gentoo.org>
AuthorDate: 2024-03-05 19:57:50 +0000
Commit:     Mike Gilbert <floppym@gentoo.org>
CommitDate: 2024-03-05 19:57:50 +0000

    net-dialup/ppp: destabilize 2.5.0-r3 for ~sparc
    
    Bug: https://bugs.gentoo.org/918992
    Signed-off-by: Mike Gilbert <floppym@gentoo.org>

 net-dialup/ppp/ppp-2.5.0-r3.ebuild | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
Comment 10 Mike Gilbert gentoo-dev 2024-03-05 21:01:37 UTC
This is really a conflict between glibc and Linux headers, and should probably be addressed in one of those projects.
Comment 11 Mike Gilbert gentoo-dev 2024-03-06 04:26:32 UTC
Created attachment 886771 [details, diff]
patch for linux-headers

Could someone test this patch for sys-kernel/linux-headers?
Comment 12 matoro archtester 2024-03-06 04:50:07 UTC
(In reply to Mike Gilbert from comment #11)
> Created attachment 886771 [details, diff] [details, diff]
> patch for linux-headers
> 
> Could someone test this patch for sys-kernel/linux-headers?

Confirmed works here, sys-kernel/linux-headers-6.6 and net-dialup/ppp-2.5.0-r6.  Passes test suite.
Comment 13 Mike Gilbert gentoo-dev 2024-03-06 04:56:11 UTC
Created attachment 886772 [details, diff]
patch for linux-headers v2
Comment 15 Larry the Git Cow gentoo-dev 2024-03-27 00:08:03 UTC
The bug has been closed via the following commit(s):

https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=69a5fc41a89f8efd0bba4479af02fe460826868e

commit 69a5fc41a89f8efd0bba4479af02fe460826868e
Author:     Mike Gilbert <floppym@gentoo.org>
AuthorDate: 2024-03-27 00:04:15 +0000
Commit:     Mike Gilbert <floppym@gentoo.org>
CommitDate: 2024-03-27 00:07:09 +0000

    sys-kernel/linux-headers: add fix for sparc
    
    Closes: https://bugs.gentoo.org/918992
    Signed-off-by: Mike Gilbert <floppym@gentoo.org>

 ...sparc-move-struct-termio-to-asm-termios.h.patch | 64 ++++++++++++++++++++++
 ...ders-6.6.ebuild => linux-headers-6.6-r1.ebuild} |  6 +-
 ...ders-6.7.ebuild => linux-headers-6.7-r1.ebuild} |  6 +-
 ...ders-6.8.ebuild => linux-headers-6.8-r1.ebuild} |  6 +-
 4 files changed, 76 insertions(+), 6 deletions(-)