Skip to content
This repository has been archived by the owner on Jan 1, 2023. It is now read-only.

[KERNEL] Perl patch does not work (5.13.2) #44

Open
f1nniboy opened this issue Aug 6, 2021 · 5 comments
Open

[KERNEL] Perl patch does not work (5.13.2) #44

f1nniboy opened this issue Aug 6, 2021 · 5 comments

Comments

@f1nniboy
Copy link

f1nniboy commented Aug 6, 2021

Hey, I am trying to build the kernel (5.13.2) without Perl but it's failing with:

Traceback (most recent call last):
  File "/usr/src/linux/build/./scripts/jobserver-exec", line 60, in <module>
    rc = subprocess.call(sys.argv[1:])
  File "/usr/lib/python3.9/subprocess.py", line 349, in call
    with Popen(*popenargs, **kwargs) as p:
  File "/usr/lib/python3.9/subprocess.py", line 951, in __init__
    self._execute_child(args, executable, preexec_fn, close_fds,
  File "/usr/lib/python3.9/subprocess.py", line 1821, in _execute_child
    raise child_exception_type(errno_num, err_msg, err_filename)
FileNotFoundError: [Errno 2] No such file or directory: 'perl'
gmake: *** [Makefile:1199: vmlinux] Error 1
gmake: INTERNAL: Exiting with 1 jobserver tokens available; should be 10!

I applied the Perl patch on a newly unpacked kernel.

I am opening this issue here because it could be that this issue is WyverKISS-specific.

@konimex
Copy link
Member

konimex commented Aug 7, 2021

Wait, python? What's your kernel config?

@f1nniboy
Copy link
Author

f1nniboy commented Aug 7, 2021

https://0x0.st/-4kb.2

@konimex
Copy link
Member

konimex commented Aug 9, 2021

I can't reproduce this with defconfig (and my personal config) in 5.13.9, but can reproduce it with your config. @dylanaraps can you reproduce this with @f1nniboy's config in a KISS system without perl? Just wanted to make sure this is not a Wyverkiss-specific issue.

@dilyn-corner
Copy link
Contributor

I'm almost certain this is a "problem" with the patch we're using; it doesn't patch perl out of EVERY kernel config option. I've run into this with some things I've enabled in the past, I even think zfs requires perl to build.

You'd have to diff the config's and see what's different and try to identify what's requiring perl to see how to extend the patch.

@dylanaraps
Copy link

dylanaraps commented Aug 9, 2021

This is where the build is failing from what I can surmise

  # Generate a linker script to ensure correct ordering of initcalls.
  gen_initcalls()
  {
      info GEN .tmp_initcalls.lds
  
      ${PYTHON} ${srctree}/scripts/jobserver-exec     \   
      ${PERL} ${srctree}/scripts/generate_initcall_order.pl   \   
          ${KBUILD_VMLINUX_OBJS} ${KBUILD_VMLINUX_LIBS}   \   
          > .tmp_initcalls.lds
  }

In scripts/linux-vmlinux.sh

This code is being run because CONFIG_LTO_CLANG=y is set.

      if [ -n "${CONFIG_LTO_CLANG}" ]; then
          gen_initcalls
          lds="-T .tmp_initcalls.lds"
  
          if [ -n "${CONFIG_MODVERSIONS}" ]; then
              gen_symversions
              lds="${lds} -T .tmp_symversions.lds"
          fi
  
          # This might take a while, so indicate that we're doing
          # an LTO link
          info LTO ${1}
      else
          info LD ${1}
      fi

NOTE: The no-perl patch only covers the OID registry (which most users will have enabled). Patch is welcome to replace usage of perl during clang LTO.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants