The pfSense Store

Author Topic: Error Building 2.4.0 Kernel  (Read 179 times)

0 Members and 1 Guest are viewing this topic.

Offline TheNarc

  • Jr. Member
  • **
  • Posts: 47
  • Karma: +11/-0
    • View Profile
Error Building 2.4.0 Kernel
« on: October 12, 2017, 03:26:17 pm »
I'm trying to compile the 2.4.0 kernel and receiving "taking address of packed member of class or structure may result in an unaligned pointer value" errors.  The sequence of steps I followed is:

The error I receive is:
In file included from /root/pfSense_2.4/sys/cam/nvme/nvme_all.h:32:
/usr/src/sys/dev/nvme/nvme.h:922:16: error: taking address of packed member 'cdw10' of class or structure 'nvme_command' may result in an
      unaligned pointer value [-Werror,-Waddress-of-packed-member]
        *(uint64_t *)&cmd->cdw10 = lba;
                      ^~~~~~~~~~


I found some suggestions that clang 4.0 was the first version to flag this as an error, so I even tried installing and using clang 3.8 instead, but I still received the same error.  I also found suggestions that the flag -Wno-address-of-packed-member would suppress this error, but I'm not sufficiently well-versed in makefiles to know where to insert this.

I have been able to sucessfully compile just the Realtek driver under this build environment, so maybe this is a moot point?  Will the stock kernel still load my compiled driver module if I just add if_re_load="YES" to /boot/loader.conf.local?

Thanks in advance to anyone who may have advice, and I'm glad to provide any further information that may be useful.

Offline TheNarc

  • Jr. Member
  • **
  • Posts: 47
  • Karma: +11/-0
    • View Profile
Re: Error Building 2.4.0 Kernel
« Reply #1 on: October 12, 2017, 10:51:49 pm »
So I'm still not clear on why I was unable to compile the kernel, but I wanted to follow up to say that it does appear that placing my compiled v1.94 Realtek if_re.ko driver in /boot/kernel/ and adding if_re_load="YES" to /boot/loader.conf.local was sufficient.  At least, I make this judgment based on the fact that if_re.ko is listed in the output from kldstat.

Offline CSylvain

  • Newbie
  • *
  • Posts: 9
  • Karma: +3/-0
    • View Profile
    • SIP-Online
Re: Error Building 2.4.0 Kernel
« Reply #2 on: October 14, 2017, 05:13:17 pm »
I also found myself with this problem, which I was able to fix with this fix : https://github.com/freebsd/freebsd/commit/6884a6e482ca6effa702761a1e3fa98bb6946c30#diff-49d9a861ee932d5b656eb20466f2a292
But other problems have occurred. :-[
I had not had this problem with the RC version, which it was in "FreeBSD 11.0", so I put a compilation environment under this version, and compilation to work.
I therefore conclude that the development team forgot to add a "BRANCH RELENG_2_4_0" on this repository: https://github.com/pfsense/FreeBSD-src

The "Main repository for pfSense" is also unusable because it refers to a "BRANCH" that is missing: https://github.com/pfsense/pfsense/blob/RELENG_2_4_0/tools/builder_defaults.sh#L108

Can someone tell us about this omission ?

Thank you !