On 10/12/2016 09:25 AM, Jakub Jelinek wrote:

No, you can just drop the aligned attributes for HPUX 32-bit, basically
introduce a new ABI.  If needed, you could add new symbol versions for
pthread_mutex_* etc. (though, if the current code doesn't care about the
alignment, perhaps you could get away without bumping that).

This is not something which can be solved with symbol versioning. It is fairly common to embed mutexes into other objects, like this:

  struct client {
    pthread_mutex_t lock;
    struct client *next;
    size_t attachment_count;
  };

The layout above is fine with the alignment change, but if the programmer writes this instead:

  struct client {
    struct client *next;
    pthread_mutex_t lock;
    size_t attachment_count;
  };

dropping the alignment means that the padding before the lock member vanishes. Consequently, we have just created a silent ABI change in application code, which is a big no-no.

Since this is PA-RISC, which is essentially dead (neither HPE nor Debian ship it anymore), I stand by my suggestion to bump the fundamental alignment instead. Sure, it is a bit inefficient, but this will only affect PA-RISC users. It does not even cause work for PA-RISC porters. Conversely, if we work on this to come up with a different fix, many more people will be affected (because they don't get all the nice things we could work on instead), and we may need to maintain a special GCC kludge for the alternative solution, impacting GCC developers in particular.

Thanks,
Florian

Reply via email to