HomeFreeBSD

When checking for symbol exports, try compiling.

Description

When checking for symbol exports, try compiling.

This patch adds a new autoconf function: SPL_LINUX_TRY_COMPILE_SYMBOL.
This new function does the following:

  • Call LINUX_TRY_COMPILE with the specified parameters.
  • If unsuccessful, return false.
  • If successful and we're configuring with --enable-linux-builtin, return true.
  • Else, call CHECK_SYMBOL_EXPORT with the specified parameters and return the result.

All calls to CHECK_SYMBOL_EXPORT are converted to
LINUX_TRY_COMPILE_SYMBOL so that the tests work even when configuring
for builtin on a kernel which doesn't have loadable module support, or
hasn't been built yet.

The only exception are:

  • AC_GET_VMALLOC_INFO, because we don't even have a public header to

include in the test case, but that's okay considering this symbol can
be ignored just fine.

  • SPL_AC_DEVICE_CREATE, which is legacy API for 2.6.18 kernels. Since

kernels this old are no longer supported it should arguably just be
removed entirely from the build system.

Note that we're also checking for the correct prototype with an actual
call, which was not the case with CHECK_SYMBOL_EXPORT. However, for
"complicated" test cases like with multiple symbol versions (e.g.
vfs_fsync), we stick with the original behavior and only check for the
function's existence.

Signed-off-by: Brian Behlendorf <behlendorf1@llnl.gov>
Issue zfsonlinux/zfs#851

Details

Provenance
Etienne Dechamps <etienne.dechamps@ovh.net>Authored on Jul 16 2012, 3:04 PM
Brian Behlendorf <behlendorf1@llnl.gov>Committed on Jul 26 2012, 10:12 PM
Parents
rGdf7cc5bc7111: Fake modpost stage for LINUX_COMPILE.
Branches
Unknown
Tags
Unknown