Skip to contentSkip to conversation

regen.sh: Limit mips o32 system calls

PATCH In review zhanglianjie 2 participants 3 messages Jul 22, 2021 – Aug 2, 2021 MIPS

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 regen.sh: Limit mips o32 system calls

With mips architecture, 64-bit programs cannot call o32 system calls. For example, __NR_stime, __NR_socketcall, __NR_time, etc. Better solve the problem described in commit: 22c2c9e2f

include/lapi/syscalls/regen.sh +1 -1
index 7a4f0cf44..8ac80440c 100755
@@ -80,7 +80,7 @@ for arch in $(cat "${srcdir}/order") ; do
 		s390) echo "#if defined(__s390__) && !defined(__s390x__)" ;;
 		mips_n32) echo "#if defined(__mips__) && defined(_ABIN32)" ;;
 		mips_n64) echo "#if defined(__mips__) && defined(_ABI64)" ;;
-		mips_o32) echo "#if defined(__mips__) && defined(_ABIO32)" ;;
+		mips_o32) echo "#if defined(__mips__) && defined(_ABIO32) && _MIPS_SZLONG == 32" ;;
 		*) echo "#ifdef __${arch}__" ;;
 	esac
 	while read line ; do

--
2.20.1

Reviewed-by on v1 1/1
#1 lore raw

Hi zhanglianjie,

Quoted 2 lines

With mips architecture, 64-bit programs cannot call o32 system calls. For example, __NR_stime, __NR_socketcall, __NR_time, etc.

@Thomas or somebody from MIPS folks, could you please confirm this?

Quoted 1 line

Better solve the problem described in commit: 22c2c9e2f

LGTM.

Kind regards,
Petr

Quoted 15 lines
include/lapi/syscalls/regen.sh +1 -1
index 7a4f0cf44..8ac80440c 100755
@@ -80,7 +80,7 @@ for arch in $(cat "${srcdir}/order") ; do
 		s390) echo "#if defined(__s390__) && !defined(__s390x__)" ;;
 		mips_n32) echo "#if defined(__mips__) && defined(_ABIN32)" ;;
 		mips_n64) echo "#if defined(__mips__) && defined(_ABI64)" ;;
-		mips_o32) echo "#if defined(__mips__) && defined(_ABIO32)" ;;
+		mips_o32) echo "#if defined(__mips__) && defined(_ABIO32) && _MIPS_SZLONG == 32" ;;
 		*) echo "#ifdef __${arch}__" ;;
 	esac
 	while read line ; do
#2 lore raw

PATCH 1/1 regen.sh: Limit mips o32 system calls

In reply to zhanglianjie

Hi zhanglianjie,

Quoted 3 lines

With mips architecture, 64-bit programs cannot call o32 system calls. For example, __NR_stime, __NR_socketcall, __NR_time, etc. Better solve the problem described in commit: 22c2c9e2f

Merged your fix and reverted 22c2c9e2f, which is not needed now.

Thanks!

Kind regards,
Petr

Quoted 15 lines
include/lapi/syscalls/regen.sh +1 -1
index 7a4f0cf44..8ac80440c 100755
@@ -80,7 +80,7 @@ for arch in $(cat "${srcdir}/order") ; do
 		s390) echo "#if defined(__s390__) && !defined(__s390x__)" ;;
 		mips_n32) echo "#if defined(__mips__) && defined(_ABIN32)" ;;
 		mips_n64) echo "#if defined(__mips__) && defined(_ABI64)" ;;
-		mips_o32) echo "#if defined(__mips__) && defined(_ABIO32)" ;;
+		mips_o32) echo "#if defined(__mips__) && defined(_ABIO32) && _MIPS_SZLONG == 32" ;;
 		*) echo "#ifdef __${arch}__" ;;
 	esac
 	while read line ; do