OS-8692

Bump illumos-kvm to gnu99

Status:
Resolved
Created:
2025-09-24T14:18:28.038-0400
Updated:
2025-09-24T14:55:38.466-0400

Description

The landing of 17536 introduces static inline int functions into sys/systm.h. On C89/gnu89 compilations, this introduces errors for anything that includes sys/systm.h. In our case in SmartOS, this affects illumos-kvm, specifically the MDB module. A change of all gnu89 directives to gnu99 in the Makefile appeared at first glance to fix it. Testing on disassembly will provide a good first-cut safety check.

Comments (2)

Dan McDonald commented on 2025-09-24T14:27:44.004-0400:

Turns out the change in the Makefile AND the change in `sys/systm.h` are effectively NOPs. Use of MD5 and SHA256 hashes seems to confirm it. Three combinations since “new-illumos with old-kvm” doesn’t compile per the Description.

Old-illumos & old-kvm

smartos-build-3(local/kvm)[0]% cd ../../illumos ; git log --stat -1 ; cd ../local/kvm ; git log --stat -1 ; foreach a ( kvm JOY_kvm_link.so kvm.so )  
commit da93770f025f972c302a243c7936baa5b71e2539 (HEAD -> master, origin/release-20250918, origin/master, origin/HEAD)
Merge: 15e1623ae5 da3b00f42a
Author: Dan McDonald <danmcd@edgecast.io>
Date:   Wed Sep 17 14:09:30 2025 -0400

            [illumos-gate merge]
    
    commit da3b00f42ac14fc3d37aa0e149de7e9832c37b6d
        17607 Common Makefile.stat usage causes build races
    commit 39242465a366677655a1cb18aefa2585126c90c7
        17611 sed: process \r, \n, and \t
    commit 50fe091cff3f2dccec5f588584a3ccb4f9933570
        17574 bhyve slowed by indirection in gpt
    
    Conflicts:
        usr/src/cmd/.gitignore
commit 02e260e223ba326d411b176db637751d89c640d5 (HEAD -> master, origin/release-20250918, origin/release-20250904, origin/release-20250821, origin/release-20250807, origin/release-20250724, origin/release-20250710, origin/release-20250626, origin/release-20250612, origin/release-20250529, origin/release-20250515, origin/release-20250501, origin/master, origin/HEAD)
Author: Dan McDonald <danmcd@mnx.io>
Date:   Tue Apr 22 17:50:09 2025 -0400

    OS-8635 Move SmartOS build to base-64-lts
    
    Reviewed by: Nahum Shalman <nahum.shalman@mnx.io>
    Reviewed by: Toomas Soome <toomas.soome@mnx.io>

 Jenkinsfile | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)
foreach? dis $a | digest -a md5
foreach? dis $a | digest -a sha256
foreach? end
5f49ddc2c8fb020ac1e6783efe3a0e17
0bf1beae17034233cfafff6eb21849deda0f60fa2a11e0d17591315ad191b160
9694d03ff3a700c9efff1ab8332ac8d5
25345fad6b99aa60dd446fff4871889c64fed571a1ad979e211d71570d379fa1
cf6879564fa618b177919e61ba00237f
05066480e7349857943cf49ebe7cc458b5e25cd74b592703106270a0dca10974
smartos-build-3(local/kvm)[0]% 

Old-illumos & new-kvm

smartos-build-2(local/kvm)[0]% cd ../../illumos ; git log --stat -1 ; cd ../local/kvm ; git log --stat -1 ; foreach a ( kvm JOY_kvm_link.so kvm.so )
commit da93770f025f972c302a243c7936baa5b71e2539 (HEAD -> master, origin/release-20250918, origin/master, origin/HEAD)
Merge: 15e1623ae5 da3b00f42a
Merge: 15e1623ae5 da3b00f42a
Author: Dan McDonald <danmcd@edgecast.io>
Date:   Wed Sep 17 14:09:30 2025 -0400

            [illumos-gate merge]
    
    commit da3b00f42ac14fc3d37aa0e149de7e9832c37b6d
        17607 Common Makefile.stat usage causes build races
    commit 39242465a366677655a1cb18aefa2585126c90c7
        17611 sed: process \r, \n, and \t
    commit 50fe091cff3f2dccec5f588584a3ccb4f9933570
        17574 bhyve slowed by indirection in gpt
    
    Conflicts:
        usr/src/cmd/.gitignore
commit 1e169310c6abafddc2189438382fac77620fafb2 (HEAD -> master)
Author: Dan McDonald <danmcd@edgecast.io>
Date:   Wed Sep 24 10:35:19 2025 -0400

    OS-xxxx Bump illumos-kvm to gnu99

 Makefile | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)
foreach? dis $a | digest -a md5                                    
foreach? dis $a | digest -a sha256
foreach? end
5f49ddc2c8fb020ac1e6783efe3a0e17
0bf1beae17034233cfafff6eb21849deda0f60fa2a11e0d17591315ad191b160
9694d03ff3a700c9efff1ab8332ac8d5
25345fad6b99aa60dd446fff4871889c64fed571a1ad979e211d71570d379fa1
cf6879564fa618b177919e61ba00237f
05066480e7349857943cf49ebe7cc458b5e25cd74b592703106270a0dca10974
smartos-build-2(local/kvm)[0]% 

New-illumos & new-kvm

smartos-build(local/kvm)[0]% cd ../../illumos ; git log --stat -1 ; cd ../local/kvm ; git log --stat -1 ; foreach a ( kvm JOY_kvm_link.so kvm.so )
commit 90acad497c89f6a6db3a3c5ba13798d2704d84a9 (HEAD -> master)
Merge: da93770f02 92ae099e20
Author: Dan McDonald <danmcd@edgecast.io>
Date:   Wed Sep 24 08:52:13 2025 -0400

            [illumos-gate merge]
    
    commit 92ae099e204069d2fec11f099863387b5317d849
        17536 overflow checks ruined by int promotion
        17540 kmdb should be built as c99
    commit ee653ea2dda5dfb303c7021b63e6ca4d2f4d642f
        17589 viona ring ops could be more efficient
    
    Conflicts:
        usr/src/uts/intel/mac/Makefile
commit 10343b8e0938e5075386cb7087df1037bfcfc2d4 (HEAD -> master)
Author: Dan McDonald <danmcd@edgecast.io>
Date:   Wed Sep 24 10:35:19 2025 -0400

    OS-xxxx Bump illumos-kvm to gnu99

 Makefile | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)
foreach? dis $a | digest -a md5
foreach? dis $a | digest -a sha256
foreach? end
5f49ddc2c8fb020ac1e6783efe3a0e17
0bf1beae17034233cfafff6eb21849deda0f60fa2a11e0d17591315ad191b160
9694d03ff3a700c9efff1ab8332ac8d5
25345fad6b99aa60dd446fff4871889c64fed571a1ad979e211d71570d379fa1
cf6879564fa618b177919e61ba00237f
05066480e7349857943cf49ebe7cc458b5e25cd74b592703106270a0dca10974
smartos-build(local/kvm)[0]% 

Dan McDonald commented on 2025-09-24T14:28:20.963-0400:

Also confirmed off the cuff on a running system:

[root@nuc ~]# dis /usr/lib/mdb/kvm/amd64/kvm.so | diff /dev/stdin /tmp/gnu99-only.dis 
1c1
< disassembly for /usr/lib/mdb/kvm/amd64/kvm.so
---
> disassembly for kvm.so
[root@nuc ~]#