All of lore.kernel.org
 help / color / mirror / Atom feed
From: Thomas Petazzoni via buildroot <buildroot@buildroot.org>
To: Sourabh Hegde <hrsourabh011@gmail.com>
Cc: buildroot@buildroot.org
Subject: Re: [Buildroot] Error linking against target architecture while building new package
Date: Thu, 14 Sep 2023 15:14:36 +0200	[thread overview]
Message-ID: <20230914151436.4c5e8073@windsurf> (raw)
In-Reply-To: <CADYjeSs78_vitxWDHo=zDMC9MJyaW7zcaQhuJn2n3AmzkvtZjA@mail.gmail.com>

On Thu, 14 Sep 2023 12:15:27 +0200
Sourabh Hegde <hrsourabh011@gmail.com> wrote:

> /usr/bin/make -j17 LDFLAGS="" -C
> /.../build/imx-nn-accelerator-lf-5.15.71-2.2.1
> SDKTARGETSYSROOT=/.../per-package/imx-nn-accelerator/host/aarch64-buildroot-linux-gnu/sysroot
> AQROOT=/.../build/imx-nn-accelerator-lf-5.15.71-2.2.1
>   LINK    libovxlib.so.1.1.0
> /usr/bin/ld: skipping incompatible
> /build/per-package/imx-nn-accelerator/host/aarch64-buildroot-linux-gnu/sysroot/usr/lib/libOpenVX.so
> when searching for -lOpenVX
> /usr/bin/ld: skipping incompatible
> /build/per-package/imx-nn-accelerator/host/aarch64-buildroot-linux-gnu/sysroot/usr/lib/libOpenVX.so
> when searching for -lOpenVX
> /usr/bin/ld: cannot find -lOpenVX
> /usr/bin/ld: skipping incompatible
> /build/per-package/imx-nn-accelerator/host/aarch64-buildroot-linux-gnu/sysroot/usr/lib/libOpenVXU.so
> when searching for -lOpenVXU
> /usr/bin/ld: skipping incompatible
> /build/per-package/imx-nn-accelerator/host/aarch64-buildroot-linux-gnu/sysroot/usr/lib/libOpenVXU.so
> when searching for -lOpenVXU
> /usr/bin/ld: cannot find -lOpenVXU
> /usr/bin/ld: skipping incompatible
> /build/per-package/imx-nn-accelerator/host/aarch64-buildroot-linux-gnu/sysroot/usr/lib/libCLC.so
> when searching for -lCLC
> /usr/bin/ld: skipping incompatible
> /build/per-package/imx-nn-accelerator/host/aarch64-buildroot-linux-gnu/sysroot/usr/lib/libCLC.so
> when searching for -lCLC
> /usr/bin/ld: cannot find -lCLC
> /usr/bin/ld: skipping incompatible
> /build/per-package/imx-nn-accelerator/host/aarch64-buildroot-linux-gnu/sysroot/usr/lib/libVSC.so
> when searching for -lVSC

You're using the host linker here (/usr/bin/ld), which of course will
not work to link binaries for the target. Replace:

define IMX_NN_ACCELERATOR_BUILD_CMDS
    $(MAKE) LDFLAGS="$(TARGET_LDFLAGS)" -C $(@D) \
        SDKTARGETSYSROOT=$(STAGING_DIR) \
        AQROOT=$(BUILD_DIR)/$(PKG_NAME)-$(PKG_VERSION)
endef

By:

define IMX_NN_ACCELERATOR_BUILD_CMDS
    $(MAKE) $(TARGET_CONFIGURE_OPTS) -C $(@D) \
        SDKTARGETSYSROOT=$(STAGING_DIR) \
        AQROOT=$(BUILD_DIR)/$(PKG_NAME)-$(PKG_VERSION)
endef

TARGET_CONFIGURE_OPTS contains the definitions of CC, LD, CFLAGS,
LDFLAGS, and a whole bunch of other variables.

Also, AQROOT can use $(IMX_NN_ACCELERATOR_BUILD_DIR) directly.

Thomas
-- 
Thomas Petazzoni, co-owner and CEO, Bootlin
Embedded Linux and Kernel engineering and training
https://bootlin.com
_______________________________________________
buildroot mailing list
buildroot@buildroot.org
https://lists.buildroot.org/mailman/listinfo/buildroot

  reply	other threads:[~2023-09-14 13:14 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-09-14 10:15 [Buildroot] Error linking against target architecture while building new package Sourabh Hegde
2023-09-14 13:14 ` Thomas Petazzoni via buildroot [this message]
2023-09-14 15:25   ` Sourabh Hegde
2023-09-14 19:47     ` Thomas Petazzoni via buildroot
2023-09-14 21:11       ` Sourabh Hegde

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20230914151436.4c5e8073@windsurf \
    --to=buildroot@buildroot.org \
    --cc=hrsourabh011@gmail.com \
    --cc=thomas.petazzoni@bootlin.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.