diff options
author | vboxsync <vboxsync@cfe28804-0f27-0410-a406-dd0f0b0b656f> | 2022-08-22 20:36:29 +0000 |
---|---|---|
committer | vboxsync <vboxsync@cfe28804-0f27-0410-a406-dd0f0b0b656f> | 2022-08-22 20:36:29 +0000 |
commit | 0bb9a78a163fe90051f295298c73b3c498d54df1 (patch) | |
tree | 4a9842042fbce5eaeaad242c025aa86ecd38d368 /tools | |
parent | f91e671f0901f3adab35d9a1af56079845cb39b4 (diff) | |
download | VirtualBox-svn-0bb9a78a163fe90051f295298c73b3c498d54df1.tar.gz |
scm: more settings fixes, making it actually find the relevant files
git-svn-id: https://www.virtualbox.org/svn/vbox/trunk@96416 cfe28804-0f27-0410-a406-dd0f0b0b656f
Diffstat (limited to 'tools')
-rw-r--r-- | tools/.scm-settings | 2 | ||||
-rw-r--r-- | tools/darwin.amd64/.scm-settings | 28 | ||||
-rwxr-xr-x | tools/darwin.amd64/bin/sdk-extractor.sh | 26 | ||||
-rwxr-xr-x | tools/darwin.amd64/bin/xcode-6.2-extractor.sh | 28 | ||||
-rw-r--r-- | tools/darwin.x86/.scm-settings | 28 | ||||
-rwxr-xr-x | tools/darwin.x86/bin/xcode-4.1-extrator.sh | 28 | ||||
-rw-r--r-- | tools/kBuildTools/VBoxXGccAmd64LinuxGnu.kmk | 26 | ||||
-rw-r--r-- | tools/kBuildTools/VBoxXGccX86RedHatLinux.kmk | 26 | ||||
-rw-r--r-- | tools/kBuildTools/VBoxXcode62.kmk | 27 | ||||
-rw-r--r-- | tools/kBuildUnits/vboximportchecker.kmk | 28 | ||||
-rw-r--r-- | tools/linux.x86/.scm-settings | 33 | ||||
-rwxr-xr-x | tools/linux.x86/kmodbuild/build-kernel.sh | 326 | ||||
-rwxr-xr-x | tools/linux.x86/kmodbuild/build-modules.sh | 26 |
13 files changed, 387 insertions, 245 deletions
diff --git a/tools/.scm-settings b/tools/.scm-settings index 23ced7667db..977d10a77b8 100644 --- a/tools/.scm-settings +++ b/tools/.scm-settings @@ -27,7 +27,7 @@ --filter-out-dirs /common/. --filter-out-dirs /freebsd.*/. ---filter-out-dirs /linux.*/. +--filter-out-dirs /linux.amd64/. --filter-out-dirs /os2.*/. --filter-out-dirs /solaris.*/. --filter-out-dirs /win.*/. diff --git a/tools/darwin.amd64/.scm-settings b/tools/darwin.amd64/.scm-settings index 6cd72df7d70..9455365c866 100644 --- a/tools/darwin.amd64/.scm-settings +++ b/tools/darwin.amd64/.scm-settings @@ -4,18 +4,28 @@ # # -# Copyright (C) 2010-2017 Oracle Corporation +# Copyright (C) 2010-2022 Oracle and/or its affiliates. # -# This file is part of VirtualBox Open Source Edition (OSE), as -# available from http://www.virtualbox.org. This file is free software; -# you can redistribute it and/or modify it under the terms of the GNU -# General Public License (GPL) as published by the Free Software -# Foundation, in version 2 as it comes in the "COPYING" file of the -# VirtualBox OSE distribution. VirtualBox OSE is distributed in the -# hope that it will be useful, but WITHOUT ANY WARRANTY of any kind. +# This file is part of VirtualBox base platform packages, as +# available from https://www.virtualbox.org. +# +# This program is free software; you can redistribute it and/or +# modify it under the terms of the GNU General Public License +# as published by the Free Software Foundation, in version 3 of the +# License. +# +# This program is distributed in the hope that it will be useful, but +# WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +# General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program; if not, see <https://www.gnu.org/licenses>. +# +# SPDX-License-Identifier: GPL-3.0-only # ---filter-files /bin/*.sh +--filter-files .scm-settings|*.sh --filter-out-dirs /qt/. --filter-out-dirs /nasm/. diff --git a/tools/darwin.amd64/bin/sdk-extractor.sh b/tools/darwin.amd64/bin/sdk-extractor.sh index 204f09bd475..e24f4de597f 100755 --- a/tools/darwin.amd64/bin/sdk-extractor.sh +++ b/tools/darwin.amd64/bin/sdk-extractor.sh @@ -5,15 +5,25 @@ # # -# Copyright (C) 2014-2020 Oracle Corporation +# Copyright (C) 2014-2022 Oracle and/or its affiliates. # -# This file is part of VirtualBox Open Source Edition (OSE), as -# available from http://www.virtualbox.org. This file is free software; -# you can redistribute it and/or modify it under the terms of the GNU -# General Public License (GPL) as published by the Free Software -# Foundation, in version 2 as it comes in the "COPYING" file of the -# VirtualBox OSE distribution. VirtualBox OSE is distributed in the -# hope that it will be useful, but WITHOUT ANY WARRANTY of any kind. +# This file is part of VirtualBox base platform packages, as +# available from https://www.virtualbox.org. +# +# This program is free software; you can redistribute it and/or +# modify it under the terms of the GNU General Public License +# as published by the Free Software Foundation, in version 3 of the +# License. +# +# This program is distributed in the hope that it will be useful, but +# WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +# General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program; if not, see <https://www.gnu.org/licenses>. +# +# SPDX-License-Identifier: GPL-3.0-only # # diff --git a/tools/darwin.amd64/bin/xcode-6.2-extractor.sh b/tools/darwin.amd64/bin/xcode-6.2-extractor.sh index 4c4f89d9dca..1be5f90326d 100755 --- a/tools/darwin.amd64/bin/xcode-6.2-extractor.sh +++ b/tools/darwin.amd64/bin/xcode-6.2-extractor.sh @@ -11,15 +11,25 @@ # # -# Copyright (C) 2014-2016 Oracle Corporation -# -# This file is part of VirtualBox Open Source Edition (OSE), as -# available from http://www.virtualbox.org. This file is free software; -# you can redistribute it and/or modify it under the terms of the GNU -# General Public License (GPL) as published by the Free Software -# Foundation, in version 2 as it comes in the "COPYING" file of the -# VirtualBox OSE distribution. VirtualBox OSE is distributed in the -# hope that it will be useful, but WITHOUT ANY WARRANTY of any kind. +# Copyright (C) 2014-2022 Oracle and/or its affiliates. +# +# This file is part of VirtualBox base platform packages, as +# available from https://www.virtualbox.org. +# +# This program is free software; you can redistribute it and/or +# modify it under the terms of the GNU General Public License +# as published by the Free Software Foundation, in version 3 of the +# License. +# +# This program is distributed in the hope that it will be useful, but +# WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +# General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program; if not, see <https://www.gnu.org/licenses>. +# +# SPDX-License-Identifier: GPL-3.0-only # # diff --git a/tools/darwin.x86/.scm-settings b/tools/darwin.x86/.scm-settings index 6cd72df7d70..9455365c866 100644 --- a/tools/darwin.x86/.scm-settings +++ b/tools/darwin.x86/.scm-settings @@ -4,18 +4,28 @@ # # -# Copyright (C) 2010-2017 Oracle Corporation +# Copyright (C) 2010-2022 Oracle and/or its affiliates. # -# This file is part of VirtualBox Open Source Edition (OSE), as -# available from http://www.virtualbox.org. This file is free software; -# you can redistribute it and/or modify it under the terms of the GNU -# General Public License (GPL) as published by the Free Software -# Foundation, in version 2 as it comes in the "COPYING" file of the -# VirtualBox OSE distribution. VirtualBox OSE is distributed in the -# hope that it will be useful, but WITHOUT ANY WARRANTY of any kind. +# This file is part of VirtualBox base platform packages, as +# available from https://www.virtualbox.org. +# +# This program is free software; you can redistribute it and/or +# modify it under the terms of the GNU General Public License +# as published by the Free Software Foundation, in version 3 of the +# License. +# +# This program is distributed in the hope that it will be useful, but +# WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +# General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program; if not, see <https://www.gnu.org/licenses>. +# +# SPDX-License-Identifier: GPL-3.0-only # ---filter-files /bin/*.sh +--filter-files .scm-settings|*.sh --filter-out-dirs /qt/. --filter-out-dirs /nasm/. diff --git a/tools/darwin.x86/bin/xcode-4.1-extrator.sh b/tools/darwin.x86/bin/xcode-4.1-extrator.sh index 8c25d72c5e1..d14e34262b6 100755 --- a/tools/darwin.x86/bin/xcode-4.1-extrator.sh +++ b/tools/darwin.x86/bin/xcode-4.1-extrator.sh @@ -4,15 +4,25 @@ # Extracts the necessary bits from the Xcode 4.1 lion package (inside installercode_41_lion.dmg). # -# Copyright (C) 2014 Oracle Corporation -# -# This file is part of VirtualBox Open Source Edition (OSE), as -# available from http://www.virtualbox.org. This file is free software; -# you can redistribute it and/or modify it under the terms of the GNU -# General Public License (GPL) as published by the Free Software -# Foundation, in version 2 as it comes in the "COPYING" file of the -# VirtualBox OSE distribution. VirtualBox OSE is distributed in the -# hope that it will be useful, but WITHOUT ANY WARRANTY of any kind. +# Copyright (C) 2014-2022 Oracle and/or its affiliates. +# +# This file is part of VirtualBox base platform packages, as +# available from https://www.virtualbox.org. +# +# This program is free software; you can redistribute it and/or +# modify it under the terms of the GNU General Public License +# as published by the Free Software Foundation, in version 3 of the +# License. +# +# This program is distributed in the hope that it will be useful, but +# WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +# General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program; if not, see <https://www.gnu.org/licenses>. +# +# SPDX-License-Identifier: GPL-3.0-only # # diff --git a/tools/kBuildTools/VBoxXGccAmd64LinuxGnu.kmk b/tools/kBuildTools/VBoxXGccAmd64LinuxGnu.kmk index f096b372d61..f96e621371c 100644 --- a/tools/kBuildTools/VBoxXGccAmd64LinuxGnu.kmk +++ b/tools/kBuildTools/VBoxXGccAmd64LinuxGnu.kmk @@ -4,15 +4,25 @@ # # -# Copyright (C) 2013-2016 Oracle Corporation +# Copyright (C) 2013-2022 Oracle and/or its affiliates. # -# This file is part of VirtualBox Open Source Edition (OSE), as -# available from http://www.virtualbox.org. This file is free software; -# you can redistribute it and/or modify it under the terms of the GNU -# General Public License (GPL) as published by the Free Software -# Foundation, in version 2 as it comes in the "COPYING" file of the -# VirtualBox OSE distribution. VirtualBox OSE is distributed in the -# hope that it will be useful, but WITHOUT ANY WARRANTY of any kind. +# This file is part of VirtualBox base platform packages, as +# available from https://www.virtualbox.org. +# +# This program is free software; you can redistribute it and/or +# modify it under the terms of the GNU General Public License +# as published by the Free Software Foundation, in version 3 of the +# License. +# +# This program is distributed in the hope that it will be useful, but +# WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +# General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program; if not, see <https://www.gnu.org/licenses>. +# +# SPDX-License-Identifier: GPL-3.0-only # TOOL_VBoxXGccAmd64LinuxGnu := GCC Cross compiler for Debian 4.0. diff --git a/tools/kBuildTools/VBoxXGccX86RedHatLinux.kmk b/tools/kBuildTools/VBoxXGccX86RedHatLinux.kmk index 6e23b79723a..066a6fc62e1 100644 --- a/tools/kBuildTools/VBoxXGccX86RedHatLinux.kmk +++ b/tools/kBuildTools/VBoxXGccX86RedHatLinux.kmk @@ -4,15 +4,25 @@ # # -# Copyright (C) 2013-2016 Oracle Corporation +# Copyright (C) 2013-2022 Oracle and/or its affiliates. # -# This file is part of VirtualBox Open Source Edition (OSE), as -# available from http://www.virtualbox.org. This file is free software; -# you can redistribute it and/or modify it under the terms of the GNU -# General Public License (GPL) as published by the Free Software -# Foundation, in version 2 as it comes in the "COPYING" file of the -# VirtualBox OSE distribution. VirtualBox OSE is distributed in the -# hope that it will be useful, but WITHOUT ANY WARRANTY of any kind. +# This file is part of VirtualBox base platform packages, as +# available from https://www.virtualbox.org. +# +# This program is free software; you can redistribute it and/or +# modify it under the terms of the GNU General Public License +# as published by the Free Software Foundation, in version 3 of the +# License. +# +# This program is distributed in the hope that it will be useful, but +# WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +# General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program; if not, see <https://www.gnu.org/licenses>. +# +# SPDX-License-Identifier: GPL-3.0-only # TOOL_VBoxXGccX86RedHatLinux := GCC Cross compiler for CentOS 3 x86. diff --git a/tools/kBuildTools/VBoxXcode62.kmk b/tools/kBuildTools/VBoxXcode62.kmk index d187adbeac2..0a2223dcef7 100644 --- a/tools/kBuildTools/VBoxXcode62.kmk +++ b/tools/kBuildTools/VBoxXcode62.kmk @@ -4,15 +4,25 @@ # # -# Copyright (C) 2016 Oracle Corporation +# Copyright (C) 2016-2022 Oracle and/or its affiliates. # -# This file is part of VirtualBox Open Source Edition (OSE), as -# available from http://www.virtualbox.org. This file is free software; -# you can redistribute it and/or modify it under the terms of the GNU -# General Public License (GPL) as published by the Free Software -# Foundation, in version 2 as it comes in the "COPYING" file of the -# VirtualBox OSE distribution. VirtualBox OSE is distributed in the -# hope that it will be useful, but WITHOUT ANY WARRANTY of any kind. +# This file is part of VirtualBox base platform packages, as +# available from https://www.virtualbox.org. +# +# This program is free software; you can redistribute it and/or +# modify it under the terms of the GNU General Public License +# as published by the Free Software Foundation, in version 3 of the +# License. +# +# This program is distributed in the hope that it will be useful, but +# WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +# General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program; if not, see <https://www.gnu.org/licenses>. +# +# SPDX-License-Identifier: GPL-3.0-only # TOOL_VBoxXcode62 := Xcode 6.2 from tools, dmg or similar @@ -482,4 +492,3 @@ define TOOL_VBoxXcode62_LINK_SYSMOD_CMDS endif endef - diff --git a/tools/kBuildUnits/vboximportchecker.kmk b/tools/kBuildUnits/vboximportchecker.kmk index 23421d282ac..b9c0d0d3ac0 100644 --- a/tools/kBuildUnits/vboximportchecker.kmk +++ b/tools/kBuildUnits/vboximportchecker.kmk @@ -4,15 +4,25 @@ # # -# Copyright (C) 2017 Oracle Corporation -# -# This file is part of VirtualBox Open Source Edition (OSE), as -# available from http://www.virtualbox.org. This file is free software; -# you can redistribute it and/or modify it under the terms of the GNU -# General Public License (GPL) as published by the Free Software -# Foundation, in version 2 as it comes in the "COPYING" file of the -# VirtualBox OSE distribution. VirtualBox OSE is distributed in the -# hope that it will be useful, but WITHOUT ANY WARRANTY of any kind. +# Copyright (C) 2017-2022 Oracle and/or its affiliates. +# +# This file is part of VirtualBox base platform packages, as +# available from https://www.virtualbox.org. +# +# This program is free software; you can redistribute it and/or +# modify it under the terms of the GNU General Public License +# as published by the Free Software Foundation, in version 3 of the +# License. +# +# This program is distributed in the hope that it will be useful, but +# WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +# General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program; if not, see <https://www.gnu.org/licenses>. +# +# SPDX-License-Identifier: GPL-3.0-only # UNIT_vboximportchecker = bldRTLdrCheckImports diff --git a/tools/linux.x86/.scm-settings b/tools/linux.x86/.scm-settings new file mode 100644 index 00000000000..37e3021a298 --- /dev/null +++ b/tools/linux.x86/.scm-settings @@ -0,0 +1,33 @@ +# $Id$ +## @file +# Source code massager settings for the tools. +# + +# +# Copyright (C) 2010-2022 Oracle and/or its affiliates. +# +# This file is part of VirtualBox base platform packages, as +# available from https://www.virtualbox.org. +# +# This program is free software; you can redistribute it and/or +# modify it under the terms of the GNU General Public License +# as published by the Free Software Foundation, in version 3 of the +# License. +# +# This program is distributed in the hope that it will be useful, but +# WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +# General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program; if not, see <https://www.gnu.org/licenses>. +# +# SPDX-License-Identifier: GPL-3.0-only +# + +--filter-files .scm-settings|*.sh + +--filter-out-dirs /bin/. +--filter-out-dirs /qt/. +--filter-out-dirs /nasm/. +--filter-out-dirs /yasm/. diff --git a/tools/linux.x86/kmodbuild/build-kernel.sh b/tools/linux.x86/kmodbuild/build-kernel.sh index 66084b28f5d..39e3540e81a 100755 --- a/tools/linux.x86/kmodbuild/build-kernel.sh +++ b/tools/linux.x86/kmodbuild/build-kernel.sh @@ -16,15 +16,25 @@ # # -# Copyright (C) 2019 Oracle Corporation +# Copyright (C) 2019-2022 Oracle and/or its affiliates. # -# This file is part of VirtualBox Open Source Edition (OSE), as -# available from http://www.virtualbox.org. This file is free software; -# you can redistribute it and/or modify it under the terms of the GNU -# General Public License (GPL) as published by the Free Software -# Foundation, in version 2 as it comes in the "COPYING" file of the -# VirtualBox OSE distribution. VirtualBox OSE is distributed in the -# hope that it will be useful, but WITHOUT ANY WARRANTY of any kind. +# This file is part of VirtualBox base platform packages, as +# available from https://www.virtualbox.org. +# +# This program is free software; you can redistribute it and/or +# modify it under the terms of the GNU General Public License +# as published by the Free Software Foundation, in version 3 of the +# License. +# +# This program is distributed in the hope that it will be useful, but +# WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +# General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program; if not, see <https://www.gnu.org/licenses>. +# +# SPDX-License-Identifier: GPL-3.0-only # # @@ -128,15 +138,15 @@ shift # perl --annoying if [ -f kernel/timeconst.pl ]; then if patch --output /tmp/build.$$ -Np1 <<EOF ---- a/kernel/timeconst.pl 2019-04-15 13:44:55.434946090 +0200 -+++ b/kernel/timeconst.pl 2019-04-15 13:57:29.330140587 +0200 +--- a/kernel/timeconst.pl 2019-04-15 13:44:55.434946090 +0200 ++++ b/kernel/timeconst.pl 2019-04-15 13:57:29.330140587 +0200 @@ -372,5 +372,5 @@ - @val = @{\$canned_values{\$hz}}; -- if (!defined(@val)) { -+ if (!@val) { - @val = compute_values(\$hz); - } - output(\$hz, @val); + @val = @{\$canned_values{\$hz}}; +- if (!defined(@val)) { ++ if (!@val) { + @val = compute_values(\$hz); + } + output(\$hz, @val); EOF then cp /tmp/build.$$ kernel/timeconst.pl @@ -152,13 +162,13 @@ index 1f790cf9d38f..3b7427aa7d85 100644 --- a/arch/x86/kernel/machine_kexec_64.c +++ b/arch/x86/kernel/machine_kexec_64.c @@ -542,6 +542,7 @@ int arch_kexec_apply_relocations_add(const Elf64_Ehdr *ehdr, - goto overflow; - break; - case R_X86_64_PC32: -+ case R_X86_64_PLT32: - value -= (u64)address; - *(u32 *)location = value; - break; + goto overflow; + break; + case R_X86_64_PC32: ++ case R_X86_64_PLT32: + value -= (u64)address; + *(u32 *)location = value; + break; EOF then cp /tmp/build.$$ arch/x86/kernel/machine_kexec_64.c @@ -171,12 +181,12 @@ index da0c160e5589..f58336af095c 100644 --- a/arch/x86/kernel/module.c +++ b/arch/x86/kernel/module.c @@ -191,6 +191,7 @@ int apply_relocate_add(Elf64_Shdr *sechdrs, - goto overflow; - break; - case R_X86_64_PC32: -+ case R_X86_64_PLT32: - val -= (u64)loc; - *(u32 *)loc = val; + goto overflow; + break; + case R_X86_64_PC32: ++ case R_X86_64_PLT32: + val -= (u64)loc; + *(u32 *)loc = val; #if 0 EOF then @@ -189,13 +199,13 @@ index da0c160e5589..f58336af095c 100644 --- a/arch/x86/kernel/module.c +++ b/arch/x86/kernel/module.c @@ -191,6 +191,7 @@ int apply_relocate_add(Elf64_Shdr *sechdrs, - goto overflow; - break; - case R_X86_64_PC32: -+ case R_X86_64_PLT32: - if (*(u32 *)loc != 0) - goto invalid_relocation; - val -= (u64)loc; + goto overflow; + break; + case R_X86_64_PC32: ++ case R_X86_64_PLT32: + if (*(u32 *)loc != 0) + goto invalid_relocation; + val -= (u64)loc; EOF then cp /tmp/build.$$ arch/x86/kernel/module.c @@ -207,54 +217,54 @@ index 5d73c443e778..220e97841e49 100644 --- a/arch/x86/tools/relocs.c +++ b/arch/x86/tools/relocs.c @@ -770,9 +770,12 @@ static int do_reloc64(struct section *sec, Elf_Rel *rel, ElfW(Sym) *sym, - break; - - case R_X86_64_PC32: -+ case R_X86_64_PLT32: - /* - * PC relative relocations don't need to be adjusted unless - * referencing a percpu symbol. -+ * -+ * NB: R_X86_64_PLT32 can be treated as R_X86_64_PC32. - */ - if (is_percpu_sym(sym, symname)) - add_reloc(&relocs32neg, offset); + break; + + case R_X86_64_PC32: ++ case R_X86_64_PLT32: + /* + * PC relative relocations don't need to be adjusted unless + * referencing a percpu symbol. ++ * ++ * NB: R_X86_64_PLT32 can be treated as R_X86_64_PC32. + */ + if (is_percpu_sym(sym, symname)) + add_reloc(&relocs32neg, offset); EOF then cp /tmp/build.$$ arch/x86/tools/relocs.c fi if patch --output /tmp/build.$$ -Np1 <<EOF ---- linux-4.15/tools/lib/subcmd/pager.c 2017-11-12 19:46:13.000000000 +0100 -+++ linux-4.17/tools/lib/subcmd/pager.c 2018-06-03 23:15:21.000000000 +0200 +--- linux-4.15/tools/lib/subcmd/pager.c 2017-11-12 19:46:13.000000000 +0100 ++++ linux-4.17/tools/lib/subcmd/pager.c 2018-06-03 23:15:21.000000000 +0200 @@ -30,10 +30,13 @@ - * have real input - */ - fd_set in; -+ fd_set exception; - - FD_ZERO(&in); -+ FD_ZERO(&exception); - FD_SET(0, &in); -- select(1, &in, NULL, &in, NULL); -+ FD_SET(0, &exception); -+ select(1, &in, NULL, &exception, NULL); - - setenv("LESS", "FRSX", 0); + * have real input + */ + fd_set in; ++ fd_set exception; + + FD_ZERO(&in); ++ FD_ZERO(&exception); + FD_SET(0, &in); +- select(1, &in, NULL, &in, NULL); ++ FD_SET(0, &exception); ++ select(1, &in, NULL, &exception, NULL); + + setenv("LESS", "FRSX", 0); } EOF then cp /tmp/build.$$ tools/lib/subcmd/pager.c fi if patch --output /tmp/build.$$ -Np1 <<EOF ---- linux-4.16/tools/lib/str_error_r.c 2019-04-15 06:04:50.978464217 +0200 -+++ linux-4.17/tools/lib/str_error_r.c 2018-06-03 23:15:21.000000000 +0200 +--- linux-4.16/tools/lib/str_error_r.c 2019-04-15 06:04:50.978464217 +0200 ++++ linux-4.17/tools/lib/str_error_r.c 2018-06-03 23:15:21.000000000 +0200 @@ -22,6 +22,6 @@ { - int err = strerror_r(errnum, buf, buflen); - if (err) -- snprintf(buf, buflen, "INTERNAL ERROR: strerror_r(%d, %p, %zd)=%d", errnum, buf, buflen, err); -+ snprintf(buf, buflen, "INTERNAL ERROR: strerror_r(%d, [buf], %zd)=%d", errnum, buflen, err); - return buf; + int err = strerror_r(errnum, buf, buflen); + if (err) +- snprintf(buf, buflen, "INTERNAL ERROR: strerror_r(%d, %p, %zd)=%d", errnum, buf, buflen, err); ++ snprintf(buf, buflen, "INTERNAL ERROR: strerror_r(%d, [buf], %zd)=%d", errnum, buflen, err); + return buf; } EOF then @@ -268,8 +278,8 @@ if [ -f include/linux/log2.h ]; then case "${KERN_VER_3PLUS_DOTS}" in 4.10.*|4.[9].*) if patch --output /tmp/build.$$ -Np1 <<EOF ---- linux-4.10/include/linux/log2.h 2017-02-19 23:34:00.000000000 +0100 -+++ linux-4.11/include/linux/log2.h 2017-11-12 19:46:13.000000000 +0100 +--- linux-4.10/include/linux/log2.h 2017-02-19 23:34:00.000000000 +0100 ++++ linux-4.11/include/linux/log2.h 2017-11-12 19:46:13.000000000 +0100 @@ -15,14 +15,8 @@ #include <linux/types.h> #include <linux/bitops.h> @@ -287,28 +297,28 @@ if [ -f include/linux/log2.h ]; then * - the arch is not required to handle n==0 if implementing the fallback @@ -84,9 +78,9 @@ */ - #define ilog2(n) \\ - ( \\ - __builtin_constant_p(n) ? ( \\ -- (n) < 1 ? ____ilog2_NaN() : \\ -+ (n) < 2 ? 0 : \\ - (n) & (1ULL << 63) ? 63 : \\ - (n) & (1ULL << 62) ? 62 : \\ - (n) & (1ULL << 61) ? 61 : \\ - (n) & (1ULL << 60) ? 60 : \\ + #define ilog2(n) \\ + ( \\ + __builtin_constant_p(n) ? ( \\ +- (n) < 1 ? ____ilog2_NaN() : \\ ++ (n) < 2 ? 0 : \\ + (n) & (1ULL << 63) ? 63 : \\ + (n) & (1ULL << 62) ? 62 : \\ + (n) & (1ULL << 61) ? 61 : \\ + (n) & (1ULL << 60) ? 60 : \\ @@ -147,12 +141,9 @@ - (n) & (1ULL << 5) ? 5 : \\ - (n) & (1ULL << 4) ? 4 : \\ - (n) & (1ULL << 3) ? 3 : \\ - (n) & (1ULL << 2) ? 2 : \\ -- (n) & (1ULL << 1) ? 1 : \\ -- (n) & (1ULL << 0) ? 0 : \\ -- ____ilog2_NaN() \\ -- ) : \\ -+ 1 ) : \\ - (sizeof(n) <= 4) ? \\ - __ilog2_u32(n) : \\ - __ilog2_u64(n) \\ + (n) & (1ULL << 5) ? 5 : \\ + (n) & (1ULL << 4) ? 4 : \\ + (n) & (1ULL << 3) ? 3 : \\ + (n) & (1ULL << 2) ? 2 : \\ +- (n) & (1ULL << 1) ? 1 : \\ +- (n) & (1ULL << 0) ? 0 : \\ +- ____ilog2_NaN() \\ +- ) : \\ ++ 1 ) : \\ + (sizeof(n) <= 4) ? \\ + __ilog2_u32(n) : \\ + __ilog2_u64(n) \\ ) EOF then @@ -325,8 +335,8 @@ if [ -f scripts/kconfig/lkc.h -a -f scripts/kconfig/mconf.c ]; then ;; 2.5.*|2.6.[012345678]) if patch --output /tmp/build.$$ -Np1 <<EOF ---- linux-2.6.8/scripts/kconfig/mconf.c 2004-08-14 07:36:32.000000000 +0200 -+++ linux-2.6.8/scripts/kconfig/mconf.c 2019-04-15 15:52:42.143587966 +0200 +--- linux-2.6.8/scripts/kconfig/mconf.c 2004-08-14 07:36:32.000000000 +0200 ++++ linux-2.6.8/scripts/kconfig/mconf.c 2019-04-15 15:52:42.143587966 +0200 @@ -88,5 +88,5 @@ static struct termios ios_org; static int rows = 0, cols = 0; @@ -346,17 +356,17 @@ fi case "${KERN_VER_3PLUS_DOTS}" in 2.6.2[456]*) if patch --output /tmp/build.$$ -Np1 <<EOF ---- linux-2.6.26/arch/x86/lib/copy_user_64.S 2019-04-15 16:21:49.475846822 +0200 -+++ linux-2.6.26/arch/x86/lib/copy_user_64.S 2019-04-15 16:21:50.883863141 +0200 +--- linux-2.6.26/arch/x86/lib/copy_user_64.S 2019-04-15 16:21:49.475846822 +0200 ++++ linux-2.6.26/arch/x86/lib/copy_user_64.S 2019-04-15 16:21:50.883863141 +0200 @@ -341,7 +341,7 @@ - 11: pop %rax - 7: ret - CFI_ENDPROC + 11: pop %rax + 7: ret + CFI_ENDPROC -END(copy_user_generic_c) +END(copy_user_generic_string) - .section __ex_table,"a" - .quad 1b,3b + .section __ex_table,"a" + .quad 1b,3b EOF then cp /tmp/build.$$ arch/x86/lib/copy_user_64.S @@ -364,17 +374,17 @@ EOF ;; 2.6.2[0123]*|2.6.19*) if patch --output /tmp/build.$$ -Np1 <<EOF ---- linux-2.6.23/arch/x86_64/lib/copy_user.S 2019-04-15 16:42:16.898006203 +0200 -+++ linux-2.6.23/arch/x86_64/lib/copy_user.S 2019-04-15 16:42:25.906109885 +0200 +--- linux-2.6.23/arch/x86_64/lib/copy_user.S 2019-04-15 16:42:16.898006203 +0200 ++++ linux-2.6.23/arch/x86_64/lib/copy_user.S 2019-04-15 16:42:25.906109885 +0200 @@ -344,7 +344,7 @@ - 11: pop %rax - 7: ret - CFI_ENDPROC + 11: pop %rax + 7: ret + CFI_ENDPROC -END(copy_user_generic_c) +END(copy_user_generic_string) - .section __ex_table,"a" - .quad 1b,3b + .section __ex_table,"a" + .quad 1b,3b EOF then cp /tmp/build.$$ arch/x86_64/lib/copy_user.S @@ -385,15 +395,15 @@ esac # Increase vdso text segment limit as newer tools/whatever causes it to be too large. if [ -f arch/x86_64/vdso/vdso.lds.S ]; then if patch --output /tmp/build.$$ -Np1 <<EOF ---- linux-2.6.23/arch/x86_64/vdso/vdso.lds.S 2019-04-15 17:20:27.567440594 +0200 -+++ linux-2.6.23/arch/x86_64/vdso/vdso.lds.S 2019-04-15 17:20:29.635463886 +0200 +--- linux-2.6.23/arch/x86_64/vdso/vdso.lds.S 2019-04-15 17:20:27.567440594 +0200 ++++ linux-2.6.23/arch/x86_64/vdso/vdso.lds.S 2019-04-15 17:20:29.635463886 +0200 @@ -28,5 +28,5 @@ - .text : { *(.text) } :text - .text.ptr : { *(.text.ptr) } :text + .text : { *(.text) } :text + .text.ptr : { *(.text.ptr) } :text - . = VDSO_PRELINK + 0x900; + . = VDSO_PRELINK + 0xa00; - .data : { *(.data) } :text - .bss : { *(.bss) } :text + .data : { *(.data) } :text + .bss : { *(.bss) } :text EOF then cp /tmp/build.$$ arch/x86_64/vdso/vdso.lds.S @@ -405,8 +415,8 @@ if [ -f scripts/mod/sumversion.c ]; then case "${KERN_VER_3PLUS_DOTS}" in 2.6.[0-9]!([0-9])*|2.6.1[0-9]*|2.6.2[01]*) if patch --output /tmp/build.$$ -Np1 <<EOF ---- linux-2.6.21/scripts/mod/sumversion.c 2007-02-04 19:44:54.000000000 +0100 -+++ linux-2.6.21/scripts/mod/sumversion.c 2019-02-15 16:10:12.956678862 +0100 +--- linux-2.6.21/scripts/mod/sumversion.c 2007-02-04 19:44:54.000000000 +0100 ++++ linux-2.6.21/scripts/mod/sumversion.c 2019-02-15 16:10:12.956678862 +0100 @@ -7,4 +7,5 @@ #include <ctype.h> #include <errno.h> @@ -425,20 +435,20 @@ if [ -f arch/x86_64/boot/tools/build.c ]; then case "${KERN_VER_3PLUS_DOTS}" in 2.6.[0-9]!([0-9])*|2.6.1[0-7]*) if patch --output /tmp/build.$$ -Np1 <<EOF ---- linux-2.6.17/arch/x86_64/boot/tools/build.c 2006-01-03 04:21:10.000000000 +0100 -+++ linux-2.6.18/arch/x86_64/boot/tools/build.c 2007-02-04 19:44:54.000000000 +0100 +--- linux-2.6.17/arch/x86_64/boot/tools/build.c 2006-01-03 04:21:10.000000000 +0100 ++++ linux-2.6.18/arch/x86_64/boot/tools/build.c 2007-02-04 19:44:54.000000000 +0100 @@ -149,9 +149,7 @@ - sz = sb.st_size; - fprintf (stderr, "System is %d kB\n", sz/1024); - sys_size = (sz + 15) / 16; -- /* 0x40000*16 = 4.0 MB, reasonable estimate for the current maximum */ -- if (sys_size > (is_big_kernel ? 0x40000 : DEF_SYSSIZE)) -- die("System is too big. Try using %smodules.", -- is_big_kernel ? "" : "bzImage or "); -+ if (!is_big_kernel && sys_size > DEF_SYSSIZE) -+ die("System is too big. Try using bzImage or modules."); - while (sz > 0) { - int l, n; + sz = sb.st_size; + fprintf (stderr, "System is %d kB\n", sz/1024); + sys_size = (sz + 15) / 16; +- /* 0x40000*16 = 4.0 MB, reasonable estimate for the current maximum */ +- if (sys_size > (is_big_kernel ? 0x40000 : DEF_SYSSIZE)) +- die("System is too big. Try using %smodules.", +- is_big_kernel ? "" : "bzImage or "); ++ if (!is_big_kernel && sys_size > DEF_SYSSIZE) ++ die("System is too big. Try using bzImage or modules."); + while (sz > 0) { + int l, n; EOF then cp /tmp/build.$$ arch/x86_64/boot/tools/build.c @@ -451,36 +461,36 @@ if [ -f arch/x86_64/kernel/process.c ]; then case "${KERN_VER_3PLUS_DOTS}" in 2.6.[0-9]!([0-9])*|2.6.1[01]*) if patch --output /tmp/build.$$ -lNp1 <<EOF ---- linux-2.6.11/arch/x86_64/kernel/process.c 2005-03-02 08:38:10.000000000 +0100 -+++ linux-2.6.11/arch/x86_64/kernel/process.c 2019-02-15 16:57:47.653585327 +0100 +--- linux-2.6.11/arch/x86_64/kernel/process.c 2005-03-02 08:38:10.000000000 +0100 ++++ linux-2.6.11/arch/x86_64/kernel/process.c 2019-02-15 16:57:47.653585327 +0100 @@ -390,10 +390,10 @@ - p->thread.fs = me->thread.fs; - p->thread.gs = me->thread.gs; - -- asm("movl %%gs,%0" : "=m" (p->thread.gsindex)); -- asm("movl %%fs,%0" : "=m" (p->thread.fsindex)); -- asm("movl %%es,%0" : "=m" (p->thread.es)); -- asm("movl %%ds,%0" : "=m" (p->thread.ds)); -+ asm("movw %%gs,%0" : "=m" (p->thread.gsindex)); -+ asm("movw %%fs,%0" : "=m" (p->thread.fsindex)); -+ asm("movw %%es,%0" : "=m" (p->thread.es)); -+ asm("movw %%ds,%0" : "=m" (p->thread.ds)); - - if (unlikely(me->thread.io_bitmap_ptr != NULL)) { - p->thread.io_bitmap_ptr = kmalloc(IO_BITMAP_BYTES, GFP_KERNEL); + p->thread.fs = me->thread.fs; + p->thread.gs = me->thread.gs; + +- asm("movl %%gs,%0" : "=m" (p->thread.gsindex)); +- asm("movl %%fs,%0" : "=m" (p->thread.fsindex)); +- asm("movl %%es,%0" : "=m" (p->thread.es)); +- asm("movl %%ds,%0" : "=m" (p->thread.ds)); ++ asm("movw %%gs,%0" : "=m" (p->thread.gsindex)); ++ asm("movw %%fs,%0" : "=m" (p->thread.fsindex)); ++ asm("movw %%es,%0" : "=m" (p->thread.es)); ++ asm("movw %%ds,%0" : "=m" (p->thread.ds)); + + if (unlikely(me->thread.io_bitmap_ptr != NULL)) { + p->thread.io_bitmap_ptr = kmalloc(IO_BITMAP_BYTES, GFP_KERNEL); @@ -456,11 +456,11 @@ - * Switch DS and ES. - * This won't pick up thread selector changes, but I guess that is ok. - */ -- asm volatile("movl %%es,%0" : "=m" (prev->es)); -+ asm volatile("movw %%es,%0" : "=m" (prev->es)); - if (unlikely(next->es | prev->es)) - loadsegment(es, next->es); - -- asm volatile ("movl %%ds,%0" : "=m" (prev->ds)); -+ asm volatile ("movw %%ds,%0" : "=m" (prev->ds)); - if (unlikely(next->ds | prev->ds)) - loadsegment(ds, next->ds); + * Switch DS and ES. + * This won't pick up thread selector changes, but I guess that is ok. + */ +- asm volatile("movl %%es,%0" : "=m" (prev->es)); ++ asm volatile("movw %%es,%0" : "=m" (prev->es)); + if (unlikely(next->es | prev->es)) + loadsegment(es, next->es); + +- asm volatile ("movl %%ds,%0" : "=m" (prev->ds)); ++ asm volatile ("movw %%ds,%0" : "=m" (prev->ds)); + if (unlikely(next->ds | prev->ds)) + loadsegment(ds, next->ds); EOF then cp /tmp/build.$$ arch/x86_64/kernel/process.c diff --git a/tools/linux.x86/kmodbuild/build-modules.sh b/tools/linux.x86/kmodbuild/build-modules.sh index 51faca8712a..5a1d90ffa67 100755 --- a/tools/linux.x86/kmodbuild/build-modules.sh +++ b/tools/linux.x86/kmodbuild/build-modules.sh @@ -9,15 +9,25 @@ # # -# Copyright (C) 2019 Oracle Corporation +# Copyright (C) 2019-2022 Oracle and/or its affiliates. # -# This file is part of VirtualBox Open Source Edition (OSE), as -# available from http://www.virtualbox.org. This file is free software; -# you can redistribute it and/or modify it under the terms of the GNU -# General Public License (GPL) as published by the Free Software -# Foundation, in version 2 as it comes in the "COPYING" file of the -# VirtualBox OSE distribution. VirtualBox OSE is distributed in the -# hope that it will be useful, but WITHOUT ANY WARRANTY of any kind. +# This file is part of VirtualBox base platform packages, as +# available from https://www.virtualbox.org. +# +# This program is free software; you can redistribute it and/or +# modify it under the terms of the GNU General Public License +# as published by the Free Software Foundation, in version 3 of the +# License. +# +# This program is distributed in the hope that it will be useful, but +# WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +# General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program; if not, see <https://www.gnu.org/licenses>. +# +# SPDX-License-Identifier: GPL-3.0-only # if [ $# -lt 2 ]; then |