Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
configure: support x86 assembly on GNU Hurd
Hurd too uses ELF and 16-byte stack alignment just like Linux and many other Unix-likes. Supposedly its host triplet can include a version number at the end. Without getting more specific about how a version number is allowed to look like, checking for *-gnu* overlaps with X32's -gnux32 suffix which is present on non-Hurd systems. Linux is the only X32 platform I know about and it uses an identical configuration to GNU Hurd, so this shouldn't be a problem. Though to be safe, let's move the case with *-gnu* at the end, to ensure if there's a "-gnux32"-like suffix on any non-Linux, non-Hurd system it will match the proper host regex before seeing Hurd's *-gnu* pattern. Thanks to youpi1 for advice about Hurd and testing.
- Loading branch information
a943ef5
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I missed a
-gnu
occurrence right in front of me and such a suffix is actually fairly common on on-Hurd besides X32. Every platform with glibc appears to get such a suffix, e.g. glibc-Linux (*-linux-gnu
) or especially notworthy kFreeBSD (-kfreebsd10.3-gnu
).Now, since Linux uses the same config anyway and
*bsd*
is checked before Hurd’s*-gnu*
, these two continue to work as expected. But in theory this might lead to an unsupported glibc platform getting (mis)configured as a Linux/Illumos/Hurd/...-like instead of printing the "contact upstream" error and potentially lead to runtime degradation or crashes.
If we’re concerend about this, we could tighten the platform check by using
$host_os
only instead of the full triplet. GNU/Hurd would then start withgnu
.Though I faintly remember some relevant bit being in found in
$host_vendor
at one occasion; not sure if that was something also relevant for building libass though. Maybe it wascygwin
and/ormingw
?But even if, we could still either split the
os
andvendor
check or match on${host_os}_${host_vendor}
instead of$host
still clearly distinguishing GNU/Hurd from glibc systems.(This also casts doubt on
-gnux32
being the universally correct check for X32, as the-gnu
part is probably from glibc. For X32 musl (experimental port) it might be-muslx32
. Since I don't see any option to test X32 on non-glibc with reasonable effort and no-one with such a system showed up and complained yet, it might be fine to leave this check for now)EDIT: Addressed by #687