SUMMARY = "Cypress Wi-Fi backports package"
DESCRIPTION = "Backports of Cypress Wi-Fi drivers from a newer kernel
version to be used with an older kernel."
LICENSE = "CLOSED"
LIC_FILES_CHKSUM = "file://LICENSE;md5=b4425e8d7d63055b514bf7732284231a"

SRC_URI = "file://cypress-fmac-v5.15.58-2024_0118.tar.gz"
#SRC_URI[sha256sum] =
"5b58e4f4e3182b60575dbbd1c5a91f55f50fefcbeef48666ceb279fa1b6db49d"
SRC_URI[sha256sum] =
"062574e1e63ffb4d9b1a67e68267126e49615d15bfeef4aea1cd14e063882eea"

S =
"${WORKDIR}/cypress-fmac-v5.15.58-2024_0118/cypress-backports-v5.15.58-2024_0118-module-src/v5.15.58-backports"
KERNEL_VERSION = "5.10.76-bsp-yocto-ampliphy-i.mx6ul-pd21.2.1"

#CFLAGS += -falign-functions=16
CFLAGS_append = " -falign-functions=32"
#EXTRA_OEMAKE += "CFLAGS+=-falign-functions=32"

# Define the kernel sources and build directories
KERNEL_SRC = "${STAGING_KERNEL_DIR}"
KERNEL_BUILD = "${STAGING_KERNEL_BUILDDIR}"

EXTRA_CFLAGS:remove = "-falign-functions"
EXTRA_CFLAGS:append = "-falign-functions=4"


# Inherit the module class to build kernel modules
inherit module

do_configure() {
    oe_runmake KLIB=${KERNEL_SRC} KLIB_BUILD=${KERNEL_BUILD}
defconfig-brcmfmac
    oe_runmake KLIB=${KERNEL_SRC} KLIB_BUILD=${KERNEL_BUILD} oldconfig
    oe_runmake KLIB=${KERNEL_SRC} KLIB_BUILD=${KERNEL_BUILD} modules
}

# Compile the backports kernel modules
#do_compile() {
#    Compile the backports kernel modules
#    oe_runmake KLIB=${KERNEL_SRC} KLIB_BUILD=${KERNEL_BUILD} modules
#}
#do_compile() {
#    oe_runmake KLIB=${KERNEL_SRC} KLIB_BUILD=${KERNEL_BUILD}
EXTRA_CFLAGS="${CFLAGS}" modules
#}

do_compile_append() {
    export KERNEL_CFLAGS="-falign-functions=16"
}


do_install() {
    # Create directory for the modules
    install -d ${D}/lib/modules/${KERNEL_VERSION}/kernel/backports/cypress

    # Locate and install the kernel modules
    find ${S} -name "brcmutil.ko" -exec install -m 0644 {}
${D}/lib/modules/${KERNEL_VERSION}/kernel/backports/cypress/ \;
    find ${S} -name "brcmfmac.ko" -exec install -m 0644 {}
${D}/lib/modules/${KERNEL_VERSION}/kernel/backports/cypress/ \;
    find ${S} -name "cfg80211.ko" -exec install -m 0644 {}
${D}/lib/modules/${KERNEL_VERSION}/kernel/backports/cypress/ \;
}


# Update module dependencies after installation
do_install_append() {
    depmod -a ${KERNEL_VERSION} -b ${D}
}

# Files to be included in the final package
FILES_${PN} +=
"/lib/modules/${KERNEL_VERSION}/kernel/backports/cypress/*.ko"
FILES_${PN} += "/lib/modules/${KERNEL_VERSION}/modules.*"
FILES_${PN} += "/lib/firmware/brcm/*.bin"

TARGET_CFLAGS:remove = "-Werror"
TARGET_CFLAGS:append = " -falign-functions=4 "

# Skip the sanity check for installed vs shipped files (if applicable)
INSANE_SKIP_${PN} = "installed-vs-shipped"

Here is the recipe that I was compiling and I'm facing the issues.

Thanks & Regards
Aravind P

On Thu, Dec 5, 2024 at 3:29 PM Quentin Schulz <quentin.sch...@cherry.de>
wrote:

> Hi Aravind,
>
> On 12/5/24 10:47 AM, aravind posina via lists.yoctoproject.org wrote:
> > Building backport-include/backport/autoconf.h ... done.
> > |   CC [M]
> >
>  
> /home/phytec/sanava-kernel/yocto/build/tmp/work/phyboard_segin_imx6ul_7-phytec-linux-gnueabi/backports-cypress/5.15.58-r0/cypress-fmac-v5.15.58-2024_0118/cypress-backports-v5.15.58-2024_0118-module-src/v5.15.58-backports/compat/main.o
> > | arm-phytec-linux-gnueabi-gcc: error: missing argument to
> > '-falign-functions='
>
> Your issue is likely here. Check the flags passed to your compiler
> either from Yocto or through the Makefile (they are sometimes/often
> entirely overridden from the Makefile, which is not correct for build
> systems).
>
> Without seeing the source code of the kernel modules (at least the
> files) and their Makefile as well as the Yocto recipe, this starts to
> look like me reading the log and highlighting where an "error" appears,
> which you probably don't need help with since I'm reading the same log
> as you. Can you please provide more info, actual source code.
>
> Cheers,
> Quentin
>
-=-=-=-=-=-=-=-=-=-=-=-
Links: You receive all messages sent to this group.
View/Reply Online (#64406): https://lists.yoctoproject.org/g/yocto/message/64406
Mute This Topic: https://lists.yoctoproject.org/mt/109831107/21656
Group Owner: yocto+ow...@lists.yoctoproject.org
Unsubscribe: https://lists.yoctoproject.org/g/yocto/unsub 
[arch...@mail-archive.com]
-=-=-=-=-=-=-=-=-=-=-=-

Reply via email to