lsb

spec .defs files need to handle arch-specific attributes

Bug #1327850 reported by Jeff Johnson
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
lsb
In Progress
Medium
Unassigned
Mandriva
In Progress
Medium

Bug Description

We have a particular case (described in bug 3849) where a structure
takes a "packed" attribute, but does so only for some architectures.
This does not emit into the .defs files used for the specification. When
the attribute is generic, it does emit.

These are the two examples:

INSERT INTO `Type` VALUES
(27726,'snd_seq_ev_ext','Struct',1263,'','No','No','No',NULL,'libasound',0);
INSERT INTO `ArchType` VALUES (1,27726,'0','',NULL,0,'(packed)');

INSERT INTO `Type` VALUES
(32378,'epoll_event','Struct',1498,'','No','No','No',NULL,'libc',0);
INSERT INTO `ArchType` VALUES (1,32378,'0','4.0',NULL,0,NULL);
INSERT INTO `ArchType` VALUES (11,32378,'12','4.0',NULL,0,'(__packed__)');
INSERT INTO `ArchType` VALUES (2,32378,'12','4.0',NULL,0,'(__packed__)');
INSERT INTO `ArchType` VALUES (3,32378,'16','4.0',NULL,0,NULL);
INSERT INTO `ArchType` VALUES (6,32378,'12','4.0',NULL,0,NULL);
INSERT INTO `ArchType` VALUES (9,32378,'16','4.0',NULL,0,NULL);
INSERT INTO `ArchType` VALUES (10,32378,'12','4.0',NULL,0,NULL);
INSERT INTO `ArchType` VALUES (12,32378,'16','4.0',NULL,0,NULL);

For the former we get:

typedef struct snd_seq_ev_ext {
    unsigned int len;
    void *ptr;
} __attribute__ ((packed)) snd_seq_ev_ext_t;

For the latter, in generic:

struct epoll_event {
    uint32_t events;
    epoll_data_t data;
};

And in x86_64, which should have the packed:

/*
 * This header is architecture neutral
 * Please refer to the generic specification for details
 */

This matters since LSB is a binary specification, and the size of a
structure is part of the ABI, so we should list if there's a reason
a struct is not going to compile to the size you would expect.

Although a "spec bug" this is actually about the generator used
in build_env/headers.

Tags: spec errata
Changed in mandriva:
importance: Unknown → Medium
status: Unknown → In Progress
Jeff Johnson (n3npq)
tags: added: spec
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.