ffi 1.17.1 → 1.17.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (74) hide show
  1. checksums.yaml +4 -4
  2. checksums.yaml.gz.sig +0 -0
  3. data/CHANGELOG.md +8 -0
  4. data/Gemfile +3 -1
  5. data/Rakefile +1 -1
  6. data/ext/ffi_c/libffi/.github/workflows/emscripten.yml +48 -60
  7. data/ext/ffi_c/libffi/Makefile.am +4 -3
  8. data/ext/ffi_c/libffi/Makefile.in +5 -25
  9. data/ext/ffi_c/libffi/README.md +19 -2
  10. data/ext/ffi_c/libffi/acinclude.m4 +6 -0
  11. data/ext/ffi_c/libffi/config.guess +80 -22
  12. data/ext/ffi_c/libffi/config.sub +161 -80
  13. data/ext/ffi_c/libffi/configure +968 -1266
  14. data/ext/ffi_c/libffi/configure.ac +9 -8
  15. data/ext/ffi_c/libffi/configure.host +0 -5
  16. data/ext/ffi_c/libffi/doc/Makefile.in +1 -0
  17. data/ext/ffi_c/libffi/doc/libffi.texi +3 -3
  18. data/ext/ffi_c/libffi/doc/version.texi +4 -4
  19. data/ext/ffi_c/libffi/fficonfig.h.in +9 -9
  20. data/ext/ffi_c/libffi/include/Makefile.in +1 -0
  21. data/ext/ffi_c/libffi/include/ffi_cfi.h +2 -0
  22. data/ext/ffi_c/libffi/include/ffi_common.h +17 -0
  23. data/ext/ffi_c/libffi/man/Makefile.in +1 -0
  24. data/ext/ffi_c/libffi/src/aarch64/ffi.c +7 -4
  25. data/ext/ffi_c/libffi/src/aarch64/ffitarget.h +2 -2
  26. data/ext/ffi_c/libffi/src/aarch64/internal.h +63 -17
  27. data/ext/ffi_c/libffi/src/aarch64/sysv.S +16 -12
  28. data/ext/ffi_c/libffi/src/arc/arcompact.S +2 -2
  29. data/ext/ffi_c/libffi/src/arc/ffi.c +6 -2
  30. data/ext/ffi_c/libffi/src/closures.c +3 -3
  31. data/ext/ffi_c/libffi/src/dlmalloc.c +1 -0
  32. data/ext/ffi_c/libffi/src/mips/ffitarget.h +2 -4
  33. data/ext/ffi_c/libffi/src/mips/n32.S +4 -0
  34. data/ext/ffi_c/libffi/src/mips/o32.S +4 -0
  35. data/ext/ffi_c/libffi/src/or1k/ffi.c +2 -2
  36. data/ext/ffi_c/libffi/src/powerpc/ffi.c +13 -0
  37. data/ext/ffi_c/libffi/src/powerpc/ffi_linux64.c +26 -19
  38. data/ext/ffi_c/libffi/src/powerpc/ffi_sysv.c +26 -16
  39. data/ext/ffi_c/libffi/src/powerpc/internal.h +10 -0
  40. data/ext/ffi_c/libffi/src/powerpc/linux64_closure.S +47 -0
  41. data/ext/ffi_c/libffi/src/powerpc/ppc_closure.S +24 -0
  42. data/ext/ffi_c/libffi/src/prep_cif.c +1 -4
  43. data/ext/ffi_c/libffi/src/s390/ffi.c +28 -1
  44. data/ext/ffi_c/libffi/src/s390/internal.h +11 -0
  45. data/ext/ffi_c/libffi/src/s390/sysv.S +38 -0
  46. data/ext/ffi_c/libffi/src/sparc/ffi.c +16 -0
  47. data/ext/ffi_c/libffi/src/wasm32/ffi.c +10 -262
  48. data/ext/ffi_c/libffi/src/x86/ffi.c +4 -1
  49. data/ext/ffi_c/libffi/src/x86/ffi64.c +4 -1
  50. data/ext/ffi_c/libffi/testsuite/Makefile.am +4 -3
  51. data/ext/ffi_c/libffi/testsuite/Makefile.in +5 -3
  52. data/ext/ffi_c/libffi/testsuite/emscripten/build-tests.sh +4 -24
  53. data/ext/ffi_c/libffi/testsuite/emscripten/build.sh +8 -25
  54. data/ext/ffi_c/libffi/testsuite/emscripten/node-tests.sh +3 -28
  55. data/ext/ffi_c/libffi/testsuite/libffi.call/callback.c +2 -2
  56. data/ext/ffi_c/libffi/testsuite/libffi.call/callback2.c +2 -2
  57. data/ext/ffi_c/libffi/testsuite/libffi.call/callback3.c +2 -2
  58. data/ext/ffi_c/libffi/testsuite/libffi.call/callback4.c +2 -2
  59. data/ext/ffi_c/libffi/testsuite/libffi.call/overread.c +54 -0
  60. data/ext/ffi_c/libffi/testsuite/libffi.call/struct_int_float.c +88 -0
  61. data/ext/ffi_c/libffi/testsuite/libffi.call/va_struct2.c +1 -0
  62. data/ext/ffi_c/libffi/testsuite/libffi.call/va_struct3.c +1 -0
  63. data/ext/ffi_c/libffi/testsuite/libffi.call/x32.c +31 -0
  64. data/ext/ffi_c/libffi/testsuite/libffi.closures/cls_multi_sshortchar.c +1 -1
  65. data/ext/ffi_c/libffi/testsuite/libffi.closures/cls_multi_ushortchar.c +1 -1
  66. data/ext/ffi_c/libffi/testsuite/libffi.complex/complex_int.c +1 -1
  67. data/lib/ffi/version.rb +1 -1
  68. data.tar.gz.sig +0 -0
  69. metadata +6 -6
  70. metadata.gz.sig +0 -0
  71. data/ext/ffi_c/libffi/.circleci/config.yml +0 -156
  72. data/ext/ffi_c/libffi/src/nios2/ffi.c +0 -304
  73. data/ext/ffi_c/libffi/src/nios2/ffitarget.h +0 -52
  74. data/ext/ffi_c/libffi/src/nios2/sysv.S +0 -136
@@ -1,10 +1,10 @@
1
1
  #! /bin/sh
2
2
  # Configuration validation subroutine script.
3
- # Copyright 1992-2022 Free Software Foundation, Inc.
3
+ # Copyright 1992-2024 Free Software Foundation, Inc.
4
4
 
5
5
  # shellcheck disable=SC2006,SC2268 # see below for rationale
6
6
 
7
- timestamp='2022-01-03'
7
+ timestamp='2024-01-01'
8
8
 
9
9
  # This file is free software; you can redistribute it and/or modify it
10
10
  # under the terms of the GNU General Public License as published by
@@ -76,13 +76,13 @@ Report bugs and patches to <config-patches@gnu.org>."
76
76
  version="\
77
77
  GNU config.sub ($timestamp)
78
78
 
79
- Copyright 1992-2022 Free Software Foundation, Inc.
79
+ Copyright 1992-2024 Free Software Foundation, Inc.
80
80
 
81
81
  This is free software; see the source for copying conditions. There is NO
82
82
  warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE."
83
83
 
84
84
  help="
85
- Try \`$me --help' for more information."
85
+ Try '$me --help' for more information."
86
86
 
87
87
  # Parse command line
88
88
  while test $# -gt 0 ; do
@@ -130,7 +130,7 @@ IFS=$saved_IFS
130
130
  # Separate into logical components for further validation
131
131
  case $1 in
132
132
  *-*-*-*-*)
133
- echo Invalid configuration \`"$1"\': more than four components >&2
133
+ echo "Invalid configuration '$1': more than four components" >&2
134
134
  exit 1
135
135
  ;;
136
136
  *-*-*-*)
@@ -145,7 +145,8 @@ case $1 in
145
145
  nto-qnx* | linux-* | uclinux-uclibc* \
146
146
  | uclinux-gnu* | kfreebsd*-gnu* | knetbsd*-gnu* | netbsd*-gnu* \
147
147
  | netbsd*-eabi* | kopensolaris*-gnu* | cloudabi*-eabi* \
148
- | storm-chaos* | os2-emx* | rtmk-nova*)
148
+ | storm-chaos* | os2-emx* | rtmk-nova* | managarm-* \
149
+ | windows-* )
149
150
  basic_machine=$field1
150
151
  basic_os=$maybe_os
151
152
  ;;
@@ -943,7 +944,7 @@ $basic_machine
943
944
  EOF
944
945
  IFS=$saved_IFS
945
946
  ;;
946
- # We use `pc' rather than `unknown'
947
+ # We use 'pc' rather than 'unknown'
947
948
  # because (1) that's what they normally are, and
948
949
  # (2) the word "unknown" tends to confuse beginning users.
949
950
  i*86 | x86_64)
@@ -1075,7 +1076,7 @@ case $cpu-$vendor in
1075
1076
  pentium-* | p5-* | k5-* | k6-* | nexgen-* | viac3-*)
1076
1077
  cpu=i586
1077
1078
  ;;
1078
- pentiumpro-* | p6-* | 6x86-* | athlon-* | athalon_*-*)
1079
+ pentiumpro-* | p6-* | 6x86-* | athlon-* | athlon_*-*)
1079
1080
  cpu=i686
1080
1081
  ;;
1081
1082
  pentiumii-* | pentium2-* | pentiumiii-* | pentium3-*)
@@ -1180,7 +1181,7 @@ case $cpu-$vendor in
1180
1181
  case $cpu in
1181
1182
  1750a | 580 \
1182
1183
  | a29k \
1183
- | aarch64 | aarch64_be \
1184
+ | aarch64 | aarch64_be | aarch64c | arm64ec \
1184
1185
  | abacus \
1185
1186
  | alpha | alphaev[4-8] | alphaev56 | alphaev6[78] \
1186
1187
  | alpha64 | alpha64ev[4-8] | alpha64ev56 | alpha64ev6[78] \
@@ -1199,50 +1200,29 @@ case $cpu-$vendor in
1199
1200
  | d10v | d30v | dlx | dsp16xx \
1200
1201
  | e2k | elxsi | epiphany \
1201
1202
  | f30[01] | f700 | fido | fr30 | frv | ft32 | fx80 \
1203
+ | javascript \
1202
1204
  | h8300 | h8500 \
1203
1205
  | hppa | hppa1.[01] | hppa2.0 | hppa2.0[nw] | hppa64 \
1204
1206
  | hexagon \
1205
1207
  | i370 | i*86 | i860 | i960 | ia16 | ia64 \
1206
1208
  | ip2k | iq2000 \
1207
1209
  | k1om \
1210
+ | kvx \
1208
1211
  | le32 | le64 \
1209
1212
  | lm32 \
1210
- | loongarch32 | loongarch64 | loongarchx32 \
1213
+ | loongarch32 | loongarch64 \
1211
1214
  | m32c | m32r | m32rle \
1212
1215
  | m5200 | m68000 | m680[012346]0 | m68360 | m683?2 | m68k \
1213
1216
  | m6811 | m68hc11 | m6812 | m68hc12 | m68hcs12x \
1214
1217
  | m88110 | m88k | maxq | mb | mcore | mep | metag \
1215
1218
  | microblaze | microblazeel \
1216
- | mips | mipsbe | mipseb | mipsel | mipsle \
1217
- | mips16 \
1218
- | mips64 | mips64eb | mips64el \
1219
- | mips64octeon | mips64octeonel \
1220
- | mips64orion | mips64orionel \
1221
- | mips64r5900 | mips64r5900el \
1222
- | mips64vr | mips64vrel \
1223
- | mips64vr4100 | mips64vr4100el \
1224
- | mips64vr4300 | mips64vr4300el \
1225
- | mips64vr5000 | mips64vr5000el \
1226
- | mips64vr5900 | mips64vr5900el \
1227
- | mipsisa32 | mipsisa32el \
1228
- | mipsisa32r2 | mipsisa32r2el \
1229
- | mipsisa32r3 | mipsisa32r3el \
1230
- | mipsisa32r5 | mipsisa32r5el \
1231
- | mipsisa32r6 | mipsisa32r6el \
1232
- | mipsisa64 | mipsisa64el \
1233
- | mipsisa64r2 | mipsisa64r2el \
1234
- | mipsisa64r3 | mipsisa64r3el \
1235
- | mipsisa64r5 | mipsisa64r5el \
1236
- | mipsisa64r6 | mipsisa64r6el \
1237
- | mipsisa64sb1 | mipsisa64sb1el \
1238
- | mipsisa64sr71k | mipsisa64sr71kel \
1239
- | mipsr5900 | mipsr5900el \
1240
- | mipstx39 | mipstx39el \
1219
+ | mips* \
1241
1220
  | mmix \
1242
1221
  | mn10200 | mn10300 \
1243
1222
  | moxie \
1244
1223
  | mt \
1245
1224
  | msp430 \
1225
+ | nanomips* \
1246
1226
  | nds32 | nds32le | nds32be \
1247
1227
  | nfp \
1248
1228
  | nios | nios2 | nios2eb | nios2el \
@@ -1274,6 +1254,7 @@ case $cpu-$vendor in
1274
1254
  | ubicom32 \
1275
1255
  | v70 | v850 | v850e | v850e1 | v850es | v850e2 | v850e2v3 \
1276
1256
  | vax \
1257
+ | vc4 \
1277
1258
  | visium \
1278
1259
  | w65 \
1279
1260
  | wasm32 | wasm64 \
@@ -1285,7 +1266,7 @@ case $cpu-$vendor in
1285
1266
  ;;
1286
1267
 
1287
1268
  *)
1288
- echo Invalid configuration \`"$1"\': machine \`"$cpu-$vendor"\' not recognized 1>&2
1269
+ echo "Invalid configuration '$1': machine '$cpu-$vendor' not recognized" 1>&2
1289
1270
  exit 1
1290
1271
  ;;
1291
1272
  esac
@@ -1306,11 +1287,12 @@ esac
1306
1287
 
1307
1288
  # Decode manufacturer-specific aliases for certain operating systems.
1308
1289
 
1309
- if test x$basic_os != x
1290
+ if test x"$basic_os" != x
1310
1291
  then
1311
1292
 
1312
1293
  # First recognize some ad-hoc cases, or perhaps split kernel-os, or else just
1313
1294
  # set os.
1295
+ obj=
1314
1296
  case $basic_os in
1315
1297
  gnu/linux*)
1316
1298
  kernel=linux
@@ -1341,6 +1323,10 @@ EOF
1341
1323
  kernel=linux
1342
1324
  os=`echo "$basic_os" | sed -e 's|linux|gnu|'`
1343
1325
  ;;
1326
+ managarm*)
1327
+ kernel=managarm
1328
+ os=`echo "$basic_os" | sed -e 's|managarm|mlibc|'`
1329
+ ;;
1344
1330
  *)
1345
1331
  kernel=
1346
1332
  os=$basic_os
@@ -1506,10 +1492,16 @@ case $os in
1506
1492
  os=eabi
1507
1493
  ;;
1508
1494
  *)
1509
- os=elf
1495
+ os=
1496
+ obj=elf
1510
1497
  ;;
1511
1498
  esac
1512
1499
  ;;
1500
+ aout* | coff* | elf* | pe*)
1501
+ # These are machine code file formats, not OSes
1502
+ obj=$os
1503
+ os=
1504
+ ;;
1513
1505
  *)
1514
1506
  # No normalization, but not necessarily accepted, that comes below.
1515
1507
  ;;
@@ -1528,12 +1520,15 @@ else
1528
1520
  # system, and we'll never get to this point.
1529
1521
 
1530
1522
  kernel=
1523
+ obj=
1531
1524
  case $cpu-$vendor in
1532
1525
  score-*)
1533
- os=elf
1526
+ os=
1527
+ obj=elf
1534
1528
  ;;
1535
1529
  spu-*)
1536
- os=elf
1530
+ os=
1531
+ obj=elf
1537
1532
  ;;
1538
1533
  *-acorn)
1539
1534
  os=riscix1.2
@@ -1543,28 +1538,35 @@ case $cpu-$vendor in
1543
1538
  os=gnu
1544
1539
  ;;
1545
1540
  arm*-semi)
1546
- os=aout
1541
+ os=
1542
+ obj=aout
1547
1543
  ;;
1548
1544
  c4x-* | tic4x-*)
1549
- os=coff
1545
+ os=
1546
+ obj=coff
1550
1547
  ;;
1551
1548
  c8051-*)
1552
- os=elf
1549
+ os=
1550
+ obj=elf
1553
1551
  ;;
1554
1552
  clipper-intergraph)
1555
1553
  os=clix
1556
1554
  ;;
1557
1555
  hexagon-*)
1558
- os=elf
1556
+ os=
1557
+ obj=elf
1559
1558
  ;;
1560
1559
  tic54x-*)
1561
- os=coff
1560
+ os=
1561
+ obj=coff
1562
1562
  ;;
1563
1563
  tic55x-*)
1564
- os=coff
1564
+ os=
1565
+ obj=coff
1565
1566
  ;;
1566
1567
  tic6x-*)
1567
- os=coff
1568
+ os=
1569
+ obj=coff
1568
1570
  ;;
1569
1571
  # This must come before the *-dec entry.
1570
1572
  pdp10-*)
@@ -1586,19 +1588,24 @@ case $cpu-$vendor in
1586
1588
  os=sunos3
1587
1589
  ;;
1588
1590
  m68*-cisco)
1589
- os=aout
1591
+ os=
1592
+ obj=aout
1590
1593
  ;;
1591
1594
  mep-*)
1592
- os=elf
1595
+ os=
1596
+ obj=elf
1593
1597
  ;;
1594
1598
  mips*-cisco)
1595
- os=elf
1599
+ os=
1600
+ obj=elf
1596
1601
  ;;
1597
- mips*-*)
1598
- os=elf
1602
+ mips*-*|nanomips*-*)
1603
+ os=
1604
+ obj=elf
1599
1605
  ;;
1600
1606
  or32-*)
1601
- os=coff
1607
+ os=
1608
+ obj=coff
1602
1609
  ;;
1603
1610
  *-tti) # must be before sparc entry or we get the wrong os.
1604
1611
  os=sysv3
@@ -1607,7 +1614,8 @@ case $cpu-$vendor in
1607
1614
  os=sunos4.1.1
1608
1615
  ;;
1609
1616
  pru-*)
1610
- os=elf
1617
+ os=
1618
+ obj=elf
1611
1619
  ;;
1612
1620
  *-be)
1613
1621
  os=beos
@@ -1688,10 +1696,12 @@ case $cpu-$vendor in
1688
1696
  os=uxpv
1689
1697
  ;;
1690
1698
  *-rom68k)
1691
- os=coff
1699
+ os=
1700
+ obj=coff
1692
1701
  ;;
1693
1702
  *-*bug)
1694
- os=coff
1703
+ os=
1704
+ obj=coff
1695
1705
  ;;
1696
1706
  *-apple)
1697
1707
  os=macos
@@ -1709,10 +1719,11 @@ esac
1709
1719
 
1710
1720
  fi
1711
1721
 
1712
- # Now, validate our (potentially fixed-up) OS.
1722
+ # Now, validate our (potentially fixed-up) individual pieces (OS, OBJ).
1723
+
1713
1724
  case $os in
1714
1725
  # Sometimes we do "kernel-libc", so those need to count as OSes.
1715
- musl* | newlib* | relibc* | uclibc*)
1726
+ llvm* | musl* | newlib* | relibc* | uclibc*)
1716
1727
  ;;
1717
1728
  # Likewise for "kernel-abi"
1718
1729
  eabi* | gnueabi*)
@@ -1720,6 +1731,9 @@ case $os in
1720
1731
  # VxWorks passes extra cpu info in the 4th filed.
1721
1732
  simlinux | simwindows | spe)
1722
1733
  ;;
1734
+ # See `case $cpu-$os` validation below
1735
+ ghcjs)
1736
+ ;;
1723
1737
  # Now accept the basic system types.
1724
1738
  # The portable systems comes first.
1725
1739
  # Each alternative MUST end in a * to match a version number.
@@ -1728,7 +1742,7 @@ case $os in
1728
1742
  | hpux* | unos* | osf* | luna* | dgux* | auroraux* | solaris* \
1729
1743
  | sym* | plan9* | psp* | sim* | xray* | os68k* | v88r* \
1730
1744
  | hiux* | abug | nacl* | netware* | windows* \
1731
- | os9* | macos* | osx* | ios* | watchos* | tvos* \
1745
+ | os9* | macos* | osx* | ios* | tvos* | watchos* \
1732
1746
  | mpw* | magic* | mmixware* | mon960* | lnews* \
1733
1747
  | amigaos* | amigados* | msdos* | newsos* | unicos* | aof* \
1734
1748
  | aos* | aros* | cloudabi* | sortix* | twizzler* \
@@ -1737,11 +1751,11 @@ case $os in
1737
1751
  | mirbsd* | netbsd* | dicos* | openedition* | ose* \
1738
1752
  | bitrig* | openbsd* | secbsd* | solidbsd* | libertybsd* | os108* \
1739
1753
  | ekkobsd* | freebsd* | riscix* | lynxos* | os400* \
1740
- | bosx* | nextstep* | cxux* | aout* | elf* | oabi* \
1741
- | ptx* | coff* | ecoff* | winnt* | domain* | vsta* \
1754
+ | bosx* | nextstep* | cxux* | oabi* \
1755
+ | ptx* | ecoff* | winnt* | domain* | vsta* \
1742
1756
  | udi* | lites* | ieee* | go32* | aux* | hcos* \
1743
1757
  | chorusrdb* | cegcc* | glidix* | serenity* \
1744
- | cygwin* | msys* | pe* | moss* | proelf* | rtems* \
1758
+ | cygwin* | msys* | moss* | proelf* | rtems* \
1745
1759
  | midipix* | mingw32* | mingw64* | mint* \
1746
1760
  | uxpv* | beos* | mpeix* | udk* | moxiebox* \
1747
1761
  | interix* | uwin* | mks* | rhapsody* | darwin* \
@@ -1754,51 +1768,118 @@ case $os in
1754
1768
  | onefs* | tirtos* | phoenix* | fuchsia* | redox* | bme* \
1755
1769
  | midnightbsd* | amdhsa* | unleashed* | emscripten* | wasi* \
1756
1770
  | nsk* | powerunix* | genode* | zvmoe* | qnx* | emx* | zephyr* \
1757
- | fiwix* )
1771
+ | fiwix* | mlibc* | cos* | mbr* | ironclad* )
1758
1772
  ;;
1759
1773
  # This one is extra strict with allowed versions
1760
1774
  sco3.2v2 | sco3.2v[4-9]* | sco5v6*)
1761
1775
  # Don't forget version if it is 3.2v4 or newer.
1762
1776
  ;;
1777
+ # This refers to builds using the UEFI calling convention
1778
+ # (which depends on the architecture) and PE file format.
1779
+ # Note that this is both a different calling convention and
1780
+ # different file format than that of GNU-EFI
1781
+ # (x86_64-w64-mingw32).
1782
+ uefi)
1783
+ ;;
1763
1784
  none)
1764
1785
  ;;
1786
+ kernel* | msvc* )
1787
+ # Restricted further below
1788
+ ;;
1789
+ '')
1790
+ if test x"$obj" = x
1791
+ then
1792
+ echo "Invalid configuration '$1': Blank OS only allowed with explicit machine code file format" 1>&2
1793
+ fi
1794
+ ;;
1795
+ *)
1796
+ echo "Invalid configuration '$1': OS '$os' not recognized" 1>&2
1797
+ exit 1
1798
+ ;;
1799
+ esac
1800
+
1801
+ case $obj in
1802
+ aout* | coff* | elf* | pe*)
1803
+ ;;
1804
+ '')
1805
+ # empty is fine
1806
+ ;;
1765
1807
  *)
1766
- echo Invalid configuration \`"$1"\': OS \`"$os"\' not recognized 1>&2
1808
+ echo "Invalid configuration '$1': Machine code format '$obj' not recognized" 1>&2
1809
+ exit 1
1810
+ ;;
1811
+ esac
1812
+
1813
+ # Here we handle the constraint that a (synthetic) cpu and os are
1814
+ # valid only in combination with each other and nowhere else.
1815
+ case $cpu-$os in
1816
+ # The "javascript-unknown-ghcjs" triple is used by GHC; we
1817
+ # accept it here in order to tolerate that, but reject any
1818
+ # variations.
1819
+ javascript-ghcjs)
1820
+ ;;
1821
+ javascript-* | *-ghcjs)
1822
+ echo "Invalid configuration '$1': cpu '$cpu' is not valid with os '$os$obj'" 1>&2
1767
1823
  exit 1
1768
1824
  ;;
1769
1825
  esac
1770
1826
 
1771
1827
  # As a final step for OS-related things, validate the OS-kernel combination
1772
1828
  # (given a valid OS), if there is a kernel.
1773
- case $kernel-$os in
1774
- linux-gnu* | linux-dietlibc* | linux-android* | linux-newlib* \
1775
- | linux-musl* | linux-relibc* | linux-uclibc* )
1829
+ case $kernel-$os-$obj in
1830
+ linux-gnu*- | linux-android*- | linux-dietlibc*- | linux-llvm*- \
1831
+ | linux-mlibc*- | linux-musl*- | linux-newlib*- \
1832
+ | linux-relibc*- | linux-uclibc*- )
1833
+ ;;
1834
+ uclinux-uclibc*- )
1835
+ ;;
1836
+ managarm-mlibc*- | managarm-kernel*- )
1776
1837
  ;;
1777
- uclinux-uclibc* )
1838
+ windows*-msvc*-)
1778
1839
  ;;
1779
- -dietlibc* | -newlib* | -musl* | -relibc* | -uclibc* )
1840
+ -dietlibc*- | -llvm*- | -mlibc*- | -musl*- | -newlib*- | -relibc*- \
1841
+ | -uclibc*- )
1780
1842
  # These are just libc implementations, not actual OSes, and thus
1781
1843
  # require a kernel.
1782
- echo "Invalid configuration \`$1': libc \`$os' needs explicit kernel." 1>&2
1844
+ echo "Invalid configuration '$1': libc '$os' needs explicit kernel." 1>&2
1783
1845
  exit 1
1784
1846
  ;;
1785
- kfreebsd*-gnu* | kopensolaris*-gnu*)
1847
+ -kernel*- )
1848
+ echo "Invalid configuration '$1': '$os' needs explicit kernel." 1>&2
1849
+ exit 1
1786
1850
  ;;
1787
- vxworks-simlinux | vxworks-simwindows | vxworks-spe)
1851
+ *-kernel*- )
1852
+ echo "Invalid configuration '$1': '$kernel' does not support '$os'." 1>&2
1853
+ exit 1
1788
1854
  ;;
1789
- nto-qnx*)
1855
+ *-msvc*- )
1856
+ echo "Invalid configuration '$1': '$os' needs 'windows'." 1>&2
1857
+ exit 1
1790
1858
  ;;
1791
- os2-emx)
1859
+ kfreebsd*-gnu*- | kopensolaris*-gnu*-)
1860
+ ;;
1861
+ vxworks-simlinux- | vxworks-simwindows- | vxworks-spe-)
1862
+ ;;
1863
+ nto-qnx*-)
1864
+ ;;
1865
+ os2-emx-)
1792
1866
  ;;
1793
- ios*-simulator | tvos*-simulator | watchos*-simulator)
1867
+ ios*-simulator* | tvos*-simulator* | watchos*-simulator*)
1868
+ ;;
1869
+ *-eabi*- | *-gnueabi*-)
1794
1870
  ;;
1795
- *-eabi* | *-gnueabi*)
1871
+ none--*)
1872
+ # None (no kernel, i.e. freestanding / bare metal),
1873
+ # can be paired with an machine code file format
1796
1874
  ;;
1797
- -*)
1875
+ -*-)
1798
1876
  # Blank kernel with real OS is always fine.
1799
1877
  ;;
1800
- *-*)
1801
- echo "Invalid configuration \`$1': Kernel \`$kernel' not known to work with OS \`$os'." 1>&2
1878
+ --*)
1879
+ # Blank kernel and OS with real machine code file format is always fine.
1880
+ ;;
1881
+ *-*-*)
1882
+ echo "Invalid configuration '$1': Kernel '$kernel' not known to work with OS '$os'." 1>&2
1802
1883
  exit 1
1803
1884
  ;;
1804
1885
  esac
@@ -1881,7 +1962,7 @@ case $vendor in
1881
1962
  ;;
1882
1963
  esac
1883
1964
 
1884
- echo "$cpu-$vendor-${kernel:+$kernel-}$os"
1965
+ echo "$cpu-$vendor${kernel:+-$kernel}${os:+-$os}${obj:+-$obj}"
1885
1966
  exit
1886
1967
 
1887
1968
  # Local variables: