Skip to content

Commit e6e9fe4

Browse files
committed
Fix loongarch64 support patch in src dir
1 parent 3469ba1 commit e6e9fe4

File tree

1 file changed

+46
-16
lines changed

1 file changed

+46
-16
lines changed

patch/patches/loongarch64_support_src_for_cef.patch

Lines changed: 46 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -57,6 +57,28 @@ index 591afd7d1dcba..68a444ebd9fbd 100644
5757
}
5858

5959
pkg_config_script = "//build/config/linux/pkg-config.py"
60+
diff --git build/config/rust.gni build/config/rust.gni
61+
index b7e3c8881b589..c4fe35c559561 100644
62+
--- build/config/rust.gni
63+
+++ build/config/rust.gni
64+
@@ -193,6 +193,8 @@ rust_abi_target = ""
65+
if (is_linux || is_chromeos) {
66+
if (current_cpu == "arm64") {
67+
rust_abi_target = "aarch64-unknown-linux-gnu"
68+
+ } else if (current_cpu == "loong64") {
69+
+ rust_abi_target = "loongarch64-unknown-linux-gnu"
70+
} else if (current_cpu == "x86") {
71+
rust_abi_target = "i686-unknown-linux-gnu"
72+
} else if (current_cpu == "x64") {
73+
@@ -299,6 +301,8 @@ if (current_cpu == "x86") {
74+
rust_target_arch = "powerpc64"
75+
} else if (current_cpu == "riscv64") {
76+
rust_target_arch = "riscv64"
77+
+} else if (current_cpu == "loong64") {
78+
+ rust_target_arch = "loongarch64"
79+
}
80+
81+
assert(!toolchain_has_rust || rust_target_arch != "")
6082
diff --git build/config/sysroot.gni build/config/sysroot.gni
6183
index 47fe4cbc840dd..d89b9b4431352 100644
6284
--- build/config/sysroot.gni
@@ -424,7 +446,7 @@ index bb0e13f4d2d9c..e9ae7ce32afc4 100644
424446
#if defined(__arm__)
425447
PTRACE_GETVFPREGS,
426448
diff --git sandbox/linux/seccomp-bpf-helpers/syscall_sets.cc sandbox/linux/seccomp-bpf-helpers/syscall_sets.cc
427-
index 4f56b6e0d10db..c550967a4309a 100644
449+
index 4f56b6e0d10db..8d40965583f64 100644
428450
--- sandbox/linux/seccomp-bpf-helpers/syscall_sets.cc
429451
+++ sandbox/linux/seccomp-bpf-helpers/syscall_sets.cc
430452
@@ -103,7 +103,7 @@ bool SyscallSets::IsUmask(int sysno) {
@@ -551,7 +573,15 @@ index 4f56b6e0d10db..c550967a4309a 100644
551573
case __NR_accept:
552574
case __NR_accept4:
553575
case __NR_bind:
554-
@@ -554,7 +561,7 @@ bool SyscallSets::IsAllowedAddressSpaceAccess(int sysno) {
576+
@@ -548,13 +555,15 @@ bool SyscallSets::IsAllowedAddressSpaceAccess(int sysno) {
577+
case __NR_mlock:
578+
case __NR_munlock:
579+
case __NR_munmap:
580+
+#if !defined(__loongarch64)
581+
case __NR_mseal:
582+
+#endif
583+
return true;
584+
case __NR_madvise:
555585
case __NR_mincore:
556586
case __NR_mlockall:
557587
#if defined(__i386__) || defined(__x86_64__) || defined(__mips__) || \
@@ -560,7 +590,7 @@ index 4f56b6e0d10db..c550967a4309a 100644
560590
case __NR_mmap:
561591
#endif
562592
#if defined(__i386__) || defined(__arm__) || \
563-
@@ -587,7 +594,7 @@ bool SyscallSets::IsAllowedGeneralIo(int sysno) {
593+
@@ -587,7 +596,7 @@ bool SyscallSets::IsAllowedGeneralIo(int sysno) {
564594
(defined(ARCH_CPU_MIPS_FAMILY) && defined(ARCH_CPU_32_BITS))
565595
case __NR__llseek:
566596
#endif
@@ -569,7 +599,7 @@ index 4f56b6e0d10db..c550967a4309a 100644
569599
case __NR_poll:
570600
#endif
571601
case __NR_ppoll:
572-
@@ -608,7 +615,7 @@ bool SyscallSets::IsAllowedGeneralIo(int sysno) {
602+
@@ -608,7 +617,7 @@ bool SyscallSets::IsAllowedGeneralIo(int sysno) {
573603
case __NR_recv:
574604
#endif
575605
#if defined(__x86_64__) || defined(__arm__) || defined(__mips__) || \
@@ -578,7 +608,7 @@ index 4f56b6e0d10db..c550967a4309a 100644
578608
case __NR_recvfrom: // Could specify source.
579609
case __NR_recvmsg: // Could specify source.
580610
#endif
581-
@@ -623,7 +630,7 @@ bool SyscallSets::IsAllowedGeneralIo(int sysno) {
611+
@@ -623,7 +632,7 @@ bool SyscallSets::IsAllowedGeneralIo(int sysno) {
582612
case __NR_send:
583613
#endif
584614
#if defined(__x86_64__) || defined(__arm__) || defined(__mips__) || \
@@ -587,7 +617,7 @@ index 4f56b6e0d10db..c550967a4309a 100644
587617
case __NR_sendmsg: // Could specify destination.
588618
case __NR_sendto: // Could specify destination.
589619
#endif
590-
@@ -672,7 +679,7 @@ bool SyscallSets::IsSeccomp(int sysno) {
620+
@@ -672,7 +681,7 @@ bool SyscallSets::IsSeccomp(int sysno) {
591621
bool SyscallSets::IsAllowedBasicScheduler(int sysno) {
592622
switch (sysno) {
593623
case __NR_sched_yield:
@@ -596,7 +626,7 @@ index 4f56b6e0d10db..c550967a4309a 100644
596626
case __NR_pause:
597627
#endif
598628
case __NR_nanosleep:
599-
@@ -756,7 +763,7 @@ bool SyscallSets::IsNuma(int sysno) {
629+
@@ -756,7 +765,7 @@ bool SyscallSets::IsNuma(int sysno) {
600630
case __NR_getcpu:
601631
case __NR_mbind:
602632
#if defined(__i386__) || defined(__x86_64__) || defined(__mips__) || \
@@ -605,7 +635,7 @@ index 4f56b6e0d10db..c550967a4309a 100644
605635
case __NR_migrate_pages:
606636
#endif
607637
case __NR_move_pages:
608-
@@ -804,7 +811,9 @@ bool SyscallSets::IsGlobalProcessEnvironment(int sysno) {
638+
@@ -804,7 +813,9 @@ bool SyscallSets::IsGlobalProcessEnvironment(int sysno) {
609639
case __NR_getrusage:
610640
case __NR_personality: // Can change its personality as well.
611641
case __NR_prlimit64: // Like setrlimit / getrlimit.
@@ -615,7 +645,7 @@ index 4f56b6e0d10db..c550967a4309a 100644
615645
case __NR_times:
616646
return true;
617647
default:
618-
@@ -826,7 +835,7 @@ bool SyscallSets::IsDebug(int sysno) {
648+
@@ -826,7 +837,7 @@ bool SyscallSets::IsDebug(int sysno) {
619649

620650
bool SyscallSets::IsGlobalSystemStatus(int sysno) {
621651
switch (sysno) {
@@ -624,7 +654,7 @@ index 4f56b6e0d10db..c550967a4309a 100644
624654
case __NR__sysctl:
625655
case __NR_sysfs:
626656
#endif
627-
@@ -844,7 +853,7 @@ bool SyscallSets::IsGlobalSystemStatus(int sysno) {
657+
@@ -844,7 +855,7 @@ bool SyscallSets::IsGlobalSystemStatus(int sysno) {
628658

629659
bool SyscallSets::IsEventFd(int sysno) {
630660
switch (sysno) {
@@ -633,7 +663,7 @@ index 4f56b6e0d10db..c550967a4309a 100644
633663
case __NR_eventfd:
634664
#endif
635665
case __NR_eventfd2:
636-
@@ -896,7 +905,8 @@ bool SyscallSets::IsKeyManagement(int sysno) {
666+
@@ -896,7 +907,8 @@ bool SyscallSets::IsKeyManagement(int sysno) {
637667
}
638668

639669
#if defined(__x86_64__) || defined(__arm__) || defined(__aarch64__) || \
@@ -643,7 +673,7 @@ index 4f56b6e0d10db..c550967a4309a 100644
643673
bool SyscallSets::IsSystemVSemaphores(int sysno) {
644674
switch (sysno) {
645675
case __NR_semctl:
646-
@@ -915,7 +925,7 @@ bool SyscallSets::IsSystemVSemaphores(int sysno) {
676+
@@ -915,7 +927,7 @@ bool SyscallSets::IsSystemVSemaphores(int sysno) {
647677
#endif
648678

649679
#if defined(__i386__) || defined(__x86_64__) || defined(__arm__) || \
@@ -652,7 +682,7 @@ index 4f56b6e0d10db..c550967a4309a 100644
652682
(defined(ARCH_CPU_MIPS_FAMILY) && defined(ARCH_CPU_64_BITS))
653683
// These give a lot of ambient authority and bypass the setuid sandbox.
654684
bool SyscallSets::IsSystemVSharedMemory(int sysno) {
655-
@@ -932,7 +942,8 @@ bool SyscallSets::IsSystemVSharedMemory(int sysno) {
685+
@@ -932,7 +944,8 @@ bool SyscallSets::IsSystemVSharedMemory(int sysno) {
656686
#endif
657687

658688
#if defined(__x86_64__) || defined(__arm__) || defined(__aarch64__) || \
@@ -662,7 +692,7 @@ index 4f56b6e0d10db..c550967a4309a 100644
662692
bool SyscallSets::IsSystemVMessageQueue(int sysno) {
663693
switch (sysno) {
664694
case __NR_msgctl:
665-
@@ -963,7 +974,8 @@ bool SyscallSets::IsSystemVIpc(int sysno) {
695+
@@ -963,7 +976,8 @@ bool SyscallSets::IsSystemVIpc(int sysno) {
666696

667697
bool SyscallSets::IsAnySystemV(int sysno) {
668698
#if defined(__x86_64__) || defined(__arm__) || defined(__aarch64__) || \
@@ -672,7 +702,7 @@ index 4f56b6e0d10db..c550967a4309a 100644
672702
return IsSystemVMessageQueue(sysno) || IsSystemVSemaphores(sysno) ||
673703
IsSystemVSharedMemory(sysno);
674704
#elif defined(__i386__) || \
675-
@@ -1000,7 +1012,7 @@ bool SyscallSets::IsAdvancedScheduler(int sysno) {
705+
@@ -1000,7 +1014,7 @@ bool SyscallSets::IsAdvancedScheduler(int sysno) {
676706
bool SyscallSets::IsInotify(int sysno) {
677707
switch (sysno) {
678708
case __NR_inotify_add_watch:
@@ -681,7 +711,7 @@ index 4f56b6e0d10db..c550967a4309a 100644
681711
case __NR_inotify_init:
682712
#endif
683713
case __NR_inotify_init1:
684-
@@ -1135,7 +1147,7 @@ bool SyscallSets::IsMisc(int sysno) {
714+
@@ -1135,7 +1149,7 @@ bool SyscallSets::IsMisc(int sysno) {
685715
#if defined(__x86_64__)
686716
case __NR_tuxcall:
687717
#endif

0 commit comments

Comments
 (0)