mismatching headers between powerpc/ppc64el and other archs

Bug #1619446 reported by Tiago Stürmer Daitx
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
linux (Ubuntu)
Confirmed
High
Unassigned

Bug Description

the header files from linux-libc-dev are causing repsnapper on -proposed to FTBFS on powerpc/ppc64el

I tracked it to 2 include clauses:

#include <sys/ioctl.h>
#include <asm/termbits.h>

causing the following error on powerpc/ppc64el builds:

following errors:

  src/printer/custom_baud.cpp: In function 'bool set_custom_baudrate(int, int)':
  src/printer/custom_baud.cpp:15:19: error: aggregate 'set_custom_baudrate(int, int)::termios2 options' has incomplete type and cannot be defined
     struct termios2 options;
                   ^
  src/printer/custom_baud.cpp:17:26: error: 'TCGETS2' was not declared in this scope
     if ( ioctl( device_fd, TCGETS2, &options ) < 0 ) {
                          ^
  src/printer/custom_baud.cpp:27:26: error: 'TCSETS2' was not declared in this scope
     if ( ioctl( device_fd, TCSETS2, &options ) < 0 ) {

Please see bug #1619100 for more info.

Comparing the powerpc/ppc64el headers to amd64 I found that they seem to be missing includes to other headers under asm-generic/

If I try to add the missing asm-generic headers:

#include <sys/ioctl.h>
#include <asm/termbits.h>
#include <asm-generic/ioctls.h>
#include <asm-generic/termbits.h>

Then the build again fails on both powerpc/ppc64el and succeeds on all other archs, this time the error is:

In file included from src/printer/custom_baud.cpp:11:0:
/usr/include/asm-generic/termbits.h:11:8: error: redefinition of ‘struct termios’
 struct termios {
        ^~~~~~~
In file included from src/printer/custom_baud.cpp:9:0:
/usr/include/powerpc-linux-gnu/asm/termbits.h:22:8: error: previous definition of ‘struct termios’
 struct termios {
        ^~~~~~~
In file included from src/printer/custom_baud.cpp:11:0:
/usr/include/asm-generic/termbits.h:31:8: error: redefinition of ‘struct ktermios’
 struct ktermios {
        ^~~~~~~~
In file included from src/printer/custom_baud.cpp:9:0:
/usr/include/powerpc-linux-gnu/asm/termbits.h:35:8: error: previous definition of ‘struct ktermios’
 struct ktermios {
        ^~~~~~~~

Finally, modifying the original includes to remove the asm/termbits.h:

#include <sys/ioctl.h>
#include <asm-generic/ioctls.h>
#include <asm-generic/termbits.h>

Allows for the repsnapper build to succeed on all arches, including powerpc/ppc64el. Question is: why is this even needed?

linux-libc-dev packages:
Get:10 http://ftpmaster.internal/ubuntu yakkety/main powerpc linux-libc-dev powerpc 4.4.0-9136.55 [818 kB]
Get:10 http://ftpmaster.internal/ubuntu yakkety/main ppc64el linux-libc-dev ppc64el 4.4.0-9136.55 [818 kB]
Get:10 http://ftpmaster.internal/ubuntu yakkety/main amd64 linux-libc-dev amd64 4.4.0-9136.55 [828 kB]

Checking the headers is seems that powerpc/ppc64el are missing includes for asm-generics:

$ grep -r TCGETS2 linux-libc-dev_4.4.0-9136.55_*/
linux-libc-dev_4.4.0-9136.55_amd64/usr/include/asm-generic/ioctls.h:#define TCGETS2 _IOR('T', 0x2A, struct termios2)
linux-libc-dev_4.4.0-9136.55_ppc64el/usr/include/asm-generic/ioctls.h:#define TCGETS2 _IOR('T', 0x2A, struct termios2)

$ grep -r ioctls.h linux-libc-dev_4.4.0-9136.55_*/
linux-libc-dev_4.4.0-9136.55_amd64/usr/include/x86_64-linux-gnu/asm/ioctls.h:#include <asm-generic/ioctls.h>
linux-libc-dev_4.4.0-9136.55_amd64/usr/include/asm-generic/termios.h:#include <asm/ioctls.h>
linux-libc-dev_4.4.0-9136.55_ppc64el/usr/include/asm-generic/termios.h:#include <asm/ioctls.h>
linux-libc-dev_4.4.0-9136.55_ppc64el/usr/include/powerpc64le-linux-gnu/asm/termios.h:#include <asm/ioctls.h>

$ grep -r "termios2 {" linux-libc-dev_4.4.0-9136.55_*/
linux-libc-dev_4.4.0-9136.55_amd64/usr/include/asm-generic/termbits.h:struct termios2 {
linux-libc-dev_4.4.0-9136.55_ppc64el/usr/include/asm-generic/termbits.h:struct termios2 {

$ grep -r termbits.h linux-libc-dev_4.4.0-9136.55_*/
linux-libc-dev_4.4.0-9136.55_amd64/usr/include/x86_64-linux-gnu/asm/termbits.h:#include <asm-generic/termbits.h>
linux-libc-dev_4.4.0-9136.55_amd64/usr/include/asm-generic/termios.h:#include <asm/termbits.h>
linux-libc-dev_4.4.0-9136.55_ppc64el/usr/include/asm-generic/termios.h:#include <asm/termbits.h>
linux-libc-dev_4.4.0-9136.55_ppc64el/usr/include/powerpc64le-linux-gnu/asm/termios.h:#include <asm/termbits.h>

summary: - mismatch headers between powerpc/ppc64el and other archs
+ mismatching headers between powerpc/ppc64el and other archs
Revision history for this message
Brad Figg (brad-figg) wrote : Missing required logs.

This bug is missing log files that will aid in diagnosing the problem. From a terminal window please run:

apport-collect 1619446

and then change the status of the bug to 'Confirmed'.

If, due to the nature of the issue you have encountered, you are unable to run this command, please add a comment stating that fact and change the bug status to 'Confirmed'.

This change has been made by an automated script, maintained by the Ubuntu Kernel Team.

Changed in linux (Ubuntu):
status: New → Incomplete
Changed in linux (Ubuntu):
status: Incomplete → Confirmed
Changed in linux (Ubuntu):
importance: Undecided → Medium
status: Confirmed → Triaged
Revision history for this message
Joseph Salisbury (jsalisbury) wrote :

Does this bug still exists with Xenial?

Changed in linux (Ubuntu):
status: Triaged → Incomplete
tags: added: kernel-da-key
Revision history for this message
Launchpad Janitor (janitor) wrote :

[Expired for linux (Ubuntu) because there has been no activity for 60 days.]

Changed in linux (Ubuntu):
status: Incomplete → Expired
Revision history for this message
Gianfranco Costamagna (costamagnagianfranco) wrote :
Changed in linux (Ubuntu):
status: Expired → Confirmed
importance: Medium → High
Brad Figg (brad-figg)
tags: added: cscc
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.