Skip to contentSkip to conversation

Out of tree module build errors since v4.20-rc1

DISCUSSION Liam R. Howlett 3 participants 4 messages Nov 21, 2018

lore
Share & tools
lore
#0 lore raw

My out of tree driver build is now reporting issues with the jump table:

./include/linux/jump_label.h: In function ‘jump_entry_code’:
./include/linux/jump_label.h:153:14: error: dereferencing pointer to incomplete type ‘const struct jump_entry’

  return entry->code;
              ^~
./include/linux/jump_label.h: In function ‘jump_entry_set_init’:
./include/linux/jump_label.h:180:7: error: dereferencing pointer to incomplete type ‘struct jump_entry’
  entry->key |= 2;
       ^~
./include/linux/jump_label.h: At top level:
./include/linux/jump_label.h:212:26: error: array type has incomplete element type ‘struct jump_entry’
 extern struct jump_entry __start___jump_table[];
                          ^~~~~~~~~~~~~~~~~~~~
./include/linux/jump_label.h:213:26: error: array type has incomplete element type ‘struct jump_entry’
 extern struct jump_entry __stop___jump_table[];
                          ^~~~~~~~~~~~~~~~~~~

This happens in v4.20-rc3 as well, so I bisected between v4.19 to v4.20-rc1 which resulted in the following commit:

b34006c4258c9c86597b6b7123d6a9a3513d6cd7 is the first bad commit commit b34006c4258c9c86597b6b7123d6a9a3513d6cd7

Author: Ard Biesheuvel <[email protected]>
Date:   Tue Sep 18 23:51:41 2018 -0700

x86/jump_table: Use relative references

Initially I assumed this was my own fault, but my module does not have these issues when using v4.19. Is there anything I should try/change in my module makefile, includes, etc to support this relative reference code?

Thank you,
Liam

#1 lore raw
Quoted 35 lines · Liam R. Howlett

My out of tree driver build is now reporting issues with the jump table:

./include/linux/jump_label.h: In function ‘jump_entry_code’:
./include/linux/jump_label.h:153:14: error: dereferencing pointer to incomplete type ‘const struct jump_entry’

 return entry->code;
             ^~
./include/linux/jump_label.h: In function ‘jump_entry_set_init’:
./include/linux/jump_label.h:180:7: error: dereferencing pointer to incomplete type ‘struct jump_entry’
 entry->key |= 2;
      ^~
./include/linux/jump_label.h: At top level:
./include/linux/jump_label.h:212:26: error: array type has incomplete element type ‘struct jump_entry’
extern struct jump_entry __start___jump_table[];
                         ^~~~~~~~~~~~~~~~~~~~
./include/linux/jump_label.h:213:26: error: array type has incomplete element type ‘struct jump_entry’
extern struct jump_entry __stop___jump_table[];
                         ^~~~~~~~~~~~~~~~~~~

This happens in v4.20-rc3 as well, so I bisected between v4.19 to v4.20-rc1 which resulted in the following commit:

b34006c4258c9c86597b6b7123d6a9a3513d6cd7 is the first bad commit commit b34006c4258c9c86597b6b7123d6a9a3513d6cd7

Author: Ard Biesheuvel <[email protected]>
Date:   Tue Sep 18 23:51:41 2018 -0700

x86/jump_table: Use relative references

Quoted 4 lines

Initially I assumed this was my own fault, but my module does not have these issues when using v4.19. Is there anything I should try/change in my module makefile, includes, etc to support this relative reference code?

Do you see HAVE_ARCH_JUMP_LABEL_RELATIVE set in your kernel config?

#2 lore raw
Quoted 35 lines · Nadav Amit
Quoted 35 lines · Liam R. Howlett

My out of tree driver build is now reporting issues with the jump table:

./include/linux/jump_label.h: In function ‘jump_entry_code’:
./include/linux/jump_label.h:153:14: error: dereferencing pointer to incomplete type ‘const struct jump_entry’

 return entry->code;
             ^~
./include/linux/jump_label.h: In function ‘jump_entry_set_init’:
./include/linux/jump_label.h:180:7: error: dereferencing pointer to incomplete type ‘struct jump_entry’
 entry->key |= 2;
      ^~
./include/linux/jump_label.h: At top level:
./include/linux/jump_label.h:212:26: error: array type has incomplete element type ‘struct jump_entry’
extern struct jump_entry __start___jump_table[];
                         ^~~~~~~~~~~~~~~~~~~~
./include/linux/jump_label.h:213:26: error: array type has incomplete element type ‘struct jump_entry’
extern struct jump_entry __stop___jump_table[];
                         ^~~~~~~~~~~~~~~~~~~

This happens in v4.20-rc3 as well, so I bisected between v4.19 to v4.20-rc1 which resulted in the following commit:

b34006c4258c9c86597b6b7123d6a9a3513d6cd7 is the first bad commit commit b34006c4258c9c86597b6b7123d6a9a3513d6cd7

Author: Ard Biesheuvel <[email protected]>
Date:   Tue Sep 18 23:51:41 2018 -0700

x86/jump_table: Use relative references

Quoted 7 lines
Quoted 4 lines

Initially I assumed this was my own fault, but my module does not have these issues when using v4.19. Is there anything I should try/change in my module makefile, includes, etc to support this relative reference code?

Do you see HAVE_ARCH_JUMP_LABEL_RELATIVE set in your kernel config?

Yes:

 $ grep HAVE_ARCH_JUMP_LABEL_RELATIVE .config
 CONFIG_HAVE_ARCH_JUMP_LABEL_RELATIVE=y

I should have mentioned I ran 'make defoldconfig' between each bisect.

#3 lore raw
Quoted 45 lines · Liam R. Howlett
Quoted 35 lines · Nadav Amit
Quoted 35 lines · Liam R. Howlett

My out of tree driver build is now reporting issues with the jump table:

./include/linux/jump_label.h: In function ‘jump_entry_code’:
./include/linux/jump_label.h:153:14: error: dereferencing pointer to incomplete type ‘const struct jump_entry’

 return entry->code;
             ^~
./include/linux/jump_label.h: In function ‘jump_entry_set_init’:
./include/linux/jump_label.h:180:7: error: dereferencing pointer to incomplete type ‘struct jump_entry’
 entry->key |= 2;
      ^~
./include/linux/jump_label.h: At top level:
./include/linux/jump_label.h:212:26: error: array type has incomplete element type ‘struct jump_entry’
extern struct jump_entry __start___jump_table[];
                         ^~~~~~~~~~~~~~~~~~~~
./include/linux/jump_label.h:213:26: error: array type has incomplete element type ‘struct jump_entry’
extern struct jump_entry __stop___jump_table[];
                         ^~~~~~~~~~~~~~~~~~~

This happens in v4.20-rc3 as well, so I bisected between v4.19 to v4.20-rc1 which resulted in the following commit:

b34006c4258c9c86597b6b7123d6a9a3513d6cd7 is the first bad commit commit b34006c4258c9c86597b6b7123d6a9a3513d6cd7

Author: Ard Biesheuvel <[email protected]>
Date:   Tue Sep 18 23:51:41 2018 -0700

x86/jump_table: Use relative references

Quoted 7 lines
Quoted 4 lines

Initially I assumed this was my own fault, but my module does not have these issues when using v4.19. Is there anything I should try/change in my module makefile, includes, etc to support this relative reference code?

Do you see HAVE_ARCH_JUMP_LABEL_RELATIVE set in your kernel config?

Quoted 6 lines

Yes:

 $ grep HAVE_ARCH_JUMP_LABEL_RELATIVE .config
 CONFIG_HAVE_ARCH_JUMP_LABEL_RELATIVE=y

I should have mentioned I ran 'make defoldconfig' between each bisect.

That is puzzling. linux/jump_label.h defines a type struct jump_label_entry if CONFIG_HAVE_ARCH_JUMP_LABEL_RELATIVE is #define'd, and so the error suggests that it is not.

Can you share the command line (with V=1) and the preprocessed result? (Re-execute the failing GCC command but replace -c with -E)