On 29/04/2022 08.25, Paul Gevers wrote:
If you're otherwise stuck, I can temporarily give you access to our host, but if you know what you'd want to try out you can also just pass detailed instructions to me and I'll execute them in the container.

Sorry, it took some time to prepare instructions while I was still in holiday 
mode.
Here is a recipe that should hopefully give me some insights what's happening.

I'm first trying to figure out what causes

 CONFTEST macros.h:
#error INIT_WORK() conftest failed!

(there are more #error conftest results, but hopefully they are all caused by 
the same underlying issue)


in an armhf autopkgtest chroot try the following:

# export parallel_jobs=1
(for a more deterministic make.log)

# apt-get install nvidia-legacy-390xx-kernel-dkms

apply the attached patch to /usr/src/nvidia-legacy-390xx-390.147/

# apt-get install linux-headers-armmp
(this will definitively fail with the patch applied)

please send me the output of that command and
/var/lib/dkms/nvidia-legacy-390xx/390.147/build/make.log


for reference, this is what I get in my chroot for this test:

 CONFTEST: INIT_WORK
+ echo #include "conftest/headers.h"
    #if defined(NV_LINUX_KCONFIG_H_PRESENT)
    #include <linux/kconfig.h>
    #endif
    #if defined(NV_GENERATED_AUTOCONF_H_PRESENT)
    #include <generated/autoconf.h>
    #else
    #include <linux/autoconf.h>
    #endif
    #if defined(CONFIG_XEN) &&         defined(CONFIG_XEN_INTERFACE_VERSION) && 
 !defined(__XEN_INTERFACE_VERSION__)
    #define __XEN_INTERFACE_VERSION__ CONFIG_XEN_INTERFACE_VERSION
    #endif
            #include <linux/workqueue.h>
            void conftest_INIT_WORK(void) {
                INIT_WORK();
            }
+ gcc-11 -O2 -D__KERNEL__ -DKBUILD_BASENAME="#conftest16692" 
-DKBUILD_MODNAME="#conftest16692" -nostdinc -isystem 
/usr/lib/gcc/arm-linux-gnueabihf/11/include -D__LINUX_ARM_ARCH__=7 -Wa,-mimplicit-it=thumb 
-I/lib/modules/5.17.0-2-armmp/source/include/asm-arm/mach-default 
-I/lib/modules/5.17.0-2-armmp/source/arch/arm/include/asm/mach-default 
-I/lib/modules/5.17.0-2-armmp/build/include2 -I/lib/modules/5.17.0-2-armmp/build/include -include 
/lib/modules/5.17.0-2-armmp/build/include/generated/autoconf.h 
-I/lib/modules/5.17.0-2-armmp/source/include -I/lib/modules/5.17.0-2-armmp/source/include/uapi 
-I/lib/modules/5.17.0-2-armmp/source/include/xen 
-I/lib/modules/5.17.0-2-armmp/build/include/generated/uapi 
-I/lib/modules/5.17.0-2-armmp/source/arch/arm/include 
-I/lib/modules/5.17.0-2-armmp/source/arch/arm/include/uapi 
-I/lib/modules/5.17.0-2-armmp/build/arch/arm/include/generated 
-I/lib/modules/5.17.0-2-armmp/build/arch/arm/include/generated/uapi -Wall -Wundef -Wno-trigraphs 
-fno-strict-aliasing -fno-common -fshort-wchar -fno-PIE -Wno-format-security -std=gnu89 
-fno-dwarf2-cfi-asm -fno-omit-frame-pointer -mapcs -mno-sched-prolog -fno-ipa-sra -mabi=aapcs-linux 
-mfpu=vfp -mtp=cp15 -marm -Wa,-mno-warn-deprecated -D__LINUX_ARM_ARCH__=7 -march=armv7-a 
-msoft-float -Uarm -fno-delete-null-pointer-checks -Wno-frame-address -Wno-format-truncation 
-Wno-format-overflow -Wno-address-of-packed-member -O2 -fno-allow-store-data-races 
-Wframe-larger-than=1024 -fstack-protector-strong -Wimplicit-fallthrough=5 -Wno-main 
-Wno-unused-but-set-variable -Wno-unused-const-variable -fno-omit-frame-pointer 
-fno-optimize-sibling-calls -fno-stack-clash-protection -pg -Wdeclaration-after-statement -Wvla 
-Wno-pointer-sign -Wcast-function-type -Wno-stringop-truncation -Wno-zero-length-bounds 
-Wno-array-bounds -Wno-stringop-overflow -Wno-restrict -Wno-maybe-uninitialized 
-Wno-alloc-size-larger-than -fno-strict-overflow -fno-stack-check -fconserve-stack 
-Wno-packed-not-aligned -g -c conftest19473.c
conftest19473.c: In function 'conftest_INIT_WORK':
conftest19473.c:15:27: error: macro "INIT_WORK" requires 2 arguments, but only 
1 given
   15 |                 INIT_WORK();
      |                           ^
In file included from conftest19473.c:13:
/lib/modules/5.17.0-2-armmp/source/include/linux/workqueue.h:244: note: macro 
"INIT_WORK" defined here
  244 | #define INIT_WORK(_work, _func)                                         
\
      |
conftest19473.c:15:17: error: 'INIT_WORK' undeclared (first use in this 
function)
   15 |                 INIT_WORK();
      |                 ^~~~~~~~~
conftest19473.c:15:17: note: each undeclared identifier is reported only once 
for each function it appears in
+ rm -f conftest19473.c
+ [ -f conftest19473.o ]
+ echo #include "conftest/headers.h"
    #if defined(NV_LINUX_KCONFIG_H_PRESENT)
    #include <linux/kconfig.h>
    #endif
    #if defined(NV_GENERATED_AUTOCONF_H_PRESENT)
    #include <generated/autoconf.h>
    #else
    #include <linux/autoconf.h>
    #endif
    #if defined(CONFIG_XEN) &&         defined(CONFIG_XEN_INTERFACE_VERSION) && 
 !defined(__XEN_INTERFACE_VERSION__)
    #define __XEN_INTERFACE_VERSION__ CONFIG_XEN_INTERFACE_VERSION
    #endif
            #include <linux/workqueue.h>
            void conftest_INIT_WORK(void) {
                INIT_WORK((struct work_struct *)NULL, NULL, NULL);
            }
+ gcc-11 -O2 -D__KERNEL__ -DKBUILD_BASENAME="#conftest16692" 
-DKBUILD_MODNAME="#conftest16692" -nostdinc -isystem 
/usr/lib/gcc/arm-linux-gnueabihf/11/include -D__LINUX_ARM_ARCH__=7 -Wa,-mimplicit-it=thumb 
-I/lib/modules/5.17.0-2-armmp/source/include/asm-arm/mach-default 
-I/lib/modules/5.17.0-2-armmp/source/arch/arm/include/asm/mach-default 
-I/lib/modules/5.17.0-2-armmp/build/include2 -I/lib/modules/5.17.0-2-armmp/build/include -include 
/lib/modules/5.17.0-2-armmp/build/include/generated/autoconf.h 
-I/lib/modules/5.17.0-2-armmp/source/include -I/lib/modules/5.17.0-2-armmp/source/include/uapi 
-I/lib/modules/5.17.0-2-armmp/source/include/xen 
-I/lib/modules/5.17.0-2-armmp/build/include/generated/uapi 
-I/lib/modules/5.17.0-2-armmp/source/arch/arm/include 
-I/lib/modules/5.17.0-2-armmp/source/arch/arm/include/uapi 
-I/lib/modules/5.17.0-2-armmp/build/arch/arm/include/generated 
-I/lib/modules/5.17.0-2-armmp/build/arch/arm/include/generated/uapi -Wall -Wundef -Wno-trigraphs 
-fno-strict-aliasing -fno-common -fshort-wchar -fno-PIE -Wno-format-security -std=gnu89 
-fno-dwarf2-cfi-asm -fno-omit-frame-pointer -mapcs -mno-sched-prolog -fno-ipa-sra -mabi=aapcs-linux 
-mfpu=vfp -mtp=cp15 -marm -Wa,-mno-warn-deprecated -D__LINUX_ARM_ARCH__=7 -march=armv7-a 
-msoft-float -Uarm -fno-delete-null-pointer-checks -Wno-frame-address -Wno-format-truncation 
-Wno-format-overflow -Wno-address-of-packed-member -O2 -fno-allow-store-data-races 
-Wframe-larger-than=1024 -fstack-protector-strong -Wimplicit-fallthrough=5 -Wno-main 
-Wno-unused-but-set-variable -Wno-unused-const-variable -fno-omit-frame-pointer 
-fno-optimize-sibling-calls -fno-stack-clash-protection -pg -Wdeclaration-after-statement -Wvla 
-Wno-pointer-sign -Wcast-function-type -Wno-stringop-truncation -Wno-zero-length-bounds 
-Wno-array-bounds -Wno-stringop-overflow -Wno-restrict -Wno-maybe-uninitialized 
-Wno-alloc-size-larger-than -fno-strict-overflow -fno-stack-check -fconserve-stack 
-Wno-packed-not-aligned -g -c conftest19473.c
 CONFTEST: ioremap_wc
 CONFTEST: acpi_walk_namespace
 CONFTEST: pci_domain_nr
conftest19473.c: In function 'conftest_INIT_WORK':
conftest19473.c:15:65: error: macro "INIT_WORK" passed 3 arguments, but takes 
just 2
   15 |                 INIT_WORK((struct work_struct *)NULL, NULL, NULL);
      |                                                                 ^
In file included from conftest19473.c:13:
/lib/modules/5.17.0-2-armmp/source/include/linux/workqueue.h:244: note: macro 
"INIT_WORK" defined here
  244 | #define INIT_WORK(_work, _func)                                         
\
      |
conftest19473.c:15:17: error: 'INIT_WORK' undeclared (first use in this 
function)
   15 |                 INIT_WORK((struct work_struct *)NULL, NULL, NULL);
      |                 ^~~~~~~~~
conftest19473.c:15:17: note: each undeclared identifier is reported only once 
for each function it appears in
+ rm -f conftest19473.c
+ [ -f conftest19473.o ]
+ echo #include "conftest/headers.h"
    #if defined(NV_LINUX_KCONFIG_H_PRESENT)
    #include <linux/kconfig.h>
    #endif
    #if defined(NV_GENERATED_AUTOCONF_H_PRESENT)
    #include <generated/autoconf.h>
    #else
    #include <linux/autoconf.h>
    #endif
    #if defined(CONFIG_XEN) &&         defined(CONFIG_XEN_INTERFACE_VERSION) && 
 !defined(__XEN_INTERFACE_VERSION__)
    #define __XEN_INTERFACE_VERSION__ CONFIG_XEN_INTERFACE_VERSION
    #endif
            #include <linux/workqueue.h>
            void conftest_INIT_WORK(void) {
                INIT_WORK((struct work_struct *)NULL, NULL);
            }
+ gcc-11 -O2 -D__KERNEL__ -DKBUILD_BASENAME="#conftest16692" 
-DKBUILD_MODNAME="#conftest16692" -nostdinc -isystem 
/usr/lib/gcc/arm-linux-gnueabihf/11/include -D__LINUX_ARM_ARCH__=7 -Wa,-mimplicit-it=thumb 
-I/lib/modules/5.17.0-2-armmp/source/include/asm-arm/mach-default 
-I/lib/modules/5.17.0-2-armmp/source/arch/arm/include/asm/mach-default 
-I/lib/modules/5.17.0-2-armmp/build/include2 -I/lib/modules/5.17.0-2-armmp/build/include -include 
/lib/modules/5.17.0-2-armmp/build/include/generated/autoconf.h 
-I/lib/modules/5.17.0-2-armmp/source/include -I/lib/modules/5.17.0-2-armmp/source/include/uapi 
-I/lib/modules/5.17.0-2-armmp/source/include/xen 
-I/lib/modules/5.17.0-2-armmp/build/include/generated/uapi 
-I/lib/modules/5.17.0-2-armmp/source/arch/arm/include 
-I/lib/modules/5.17.0-2-armmp/source/arch/arm/include/uapi 
-I/lib/modules/5.17.0-2-armmp/build/arch/arm/include/generated 
-I/lib/modules/5.17.0-2-armmp/build/arch/arm/include/generated/uapi -Wall -Wundef -Wno-trigraphs 
-fno-strict-aliasing -fno-common -fshort-wchar -fno-PIE -Wno-format-security -std=gnu89 
-fno-dwarf2-cfi-asm -fno-omit-frame-pointer -mapcs -mno-sched-prolog -fno-ipa-sra -mabi=aapcs-linux 
-mfpu=vfp -mtp=cp15 -marm -Wa,-mno-warn-deprecated -D__LINUX_ARM_ARCH__=7 -march=armv7-a 
-msoft-float -Uarm -fno-delete-null-pointer-checks -Wno-frame-address -Wno-format-truncation 
-Wno-format-overflow -Wno-address-of-packed-member -O2 -fno-allow-store-data-races 
-Wframe-larger-than=1024 -fstack-protector-strong -Wimplicit-fallthrough=5 -Wno-main 
-Wno-unused-but-set-variable -Wno-unused-const-variable -fno-omit-frame-pointer 
-fno-optimize-sibling-calls -fno-stack-clash-protection -pg -Wdeclaration-after-statement -Wvla 
-Wno-pointer-sign -Wcast-function-type -Wno-stringop-truncation -Wno-zero-length-bounds 
-Wno-array-bounds -Wno-stringop-overflow -Wno-restrict -Wno-maybe-uninitialized 
-Wno-alloc-size-larger-than -fno-strict-overflow -fno-stack-check -fconserve-stack 
-Wno-packed-not-aligned -g -c conftest19473.c
+ rm -f conftest19473.c
+ [ -f conftest19473.o ]
+ append_conftest macros
+ read LINE
+ echo #define NV_INIT_WORK_PRESENT
+ echo #define NV_INIT_WORK_PRESENT
+ read LINE
+ append_conftest macros
+ read LINE
+ echo #define NV_INIT_WORK_ARGUMENT_COUNT 2
+ echo #define NV_INIT_WORK_ARGUMENT_COUNT 2
+ read LINE
+ rm -f conftest19473.o
+ exit 1

Thanks

Andreas
diff -ur nvidia-legacy-390xx-390.147.orig/conftest.sh nvidia-legacy-390xx-390.147/conftest.sh
--- nvidia-legacy-390xx-390.147.orig/conftest.sh	2021-12-13 06:13:23.000000000 +0000
+++ nvidia-legacy-390xx-390.147/conftest.sh	2022-05-18 07:06:53.280773269 +0000
@@ -1271,6 +1271,7 @@
         ;;
 
       INIT_WORK)
+	      set -x
             #
             # Determine how many arguments the INIT_WORK() macro
             # takes.
@@ -1281,7 +1282,7 @@
                 INIT_WORK();
             }" > conftest$$.c
 
-            $CC $CFLAGS -c conftest$$.c > /dev/null 2>&1
+            $CC $CFLAGS -c conftest$$.c #> /dev/null 2>&1
             rm -f conftest$$.c
 
             if [ -f conftest$$.o ]; then
@@ -1296,13 +1297,14 @@
                 INIT_WORK((struct work_struct *)NULL, NULL, NULL);
             }" > conftest$$.c
 
-            $CC $CFLAGS -c conftest$$.c > /dev/null 2>&1
+            $CC $CFLAGS -c conftest$$.c #> /dev/null 2>&1
             rm -f conftest$$.c
 
             if [ -f conftest$$.o ]; then
                 echo "#define NV_INIT_WORK_PRESENT" | append_conftest "macros"
                 echo "#define NV_INIT_WORK_ARGUMENT_COUNT 3" | append_conftest "macros"
                 rm -f conftest$$.o
+		exit 1
                 return
             fi
 
@@ -1312,16 +1314,18 @@
                 INIT_WORK((struct work_struct *)NULL, NULL);
             }" > conftest$$.c
 
-            $CC $CFLAGS -c conftest$$.c > /dev/null 2>&1
+            $CC $CFLAGS -c conftest$$.c #> /dev/null 2>&1
             rm -f conftest$$.c
 
             if [ -f conftest$$.o ]; then
                 echo "#define NV_INIT_WORK_PRESENT" | append_conftest "macros"
                 echo "#define NV_INIT_WORK_ARGUMENT_COUNT 2" | append_conftest "macros"
                 rm -f conftest$$.o
+		exit 1
                 return
             else
                 echo "#error INIT_WORK() conftest failed!" | append_conftest "macros"
+		exit 1
                 return
             fi
         ;;

Reply via email to