Coder Social home page Coder Social logo

Compiling C++ bindings with buildroot fails: ERROR: unsafe header/library path used in cross-compilation: '-L/usr/lib' about libgpiod HOT 10 CLOSED

brgl avatar brgl commented on August 25, 2024
Compiling C++ bindings with buildroot fails: ERROR: unsafe header/library path used in cross-compilation: '-L/usr/lib'

from libgpiod.

Comments (10)

brgl avatar brgl commented on August 25, 2024

This isn't part of any release yet, it's still WIP. I will surely address any build issues before releasing 1.1.

from libgpiod.

jktjkt avatar jktjkt commented on August 25, 2024

Yeah, sure, I understand that. I just wanted to make myself known as an interested user, and to report back what I have. I'm very interested in C++ bindings because that would help me nuke some of my code :).

from libgpiod.

brgl avatar brgl commented on August 25, 2024

Cool, please don't hesitate to let me know should you find a solution before I do.

from libgpiod.

jktjkt avatar jktjkt commented on August 25, 2024

A small update -- at first, I was running ./autogen.sh, which also runs ./configure. That is obviously wrong. However, even just initializing the dir by running git clean -dxf; autoreconf --force --install --verbose doesn't change anything.

from libgpiod.

brgl avatar brgl commented on August 25, 2024

For buildroot, I'd advise to first run make dist from the repo, unpack the tarball somewhere and then use the local SITE_METHOD to fetch the packaged source.

from libgpiod.

brgl avatar brgl commented on August 25, 2024

@jktjkt interesting - I can't build the C++ bindings in buildroot either and am getting the same error, but the yocto SDK builds it fine. I guess there's something in the buildroot environment.

from libgpiod.

heinemml avatar heinemml commented on August 25, 2024

Just a observation by me. In my Buildroot it compiles.

By comparison of the failing command I see that I'm not using the -fstack-protector-strong parameter.
So your ERROR is a WARNING in my build and runs through. Maybe this is the same reason why it works with yocto?

from libgpiod.

heinemml avatar heinemml commented on August 25, 2024

Found this Buildroot issue, which pretty much resembles this problem: http://lists.busybox.net/pipermail/buildroot/2016-September/172127.html

In short: Buildroot requires a patched libtool to handle the different path for crosscompilation.
So with this libgpiod.mk I can build from the local git clone. (running autoreconf --force --install --verbose before building).

Note, this also adds the dependency on autoconf-archive for the host toolchain which is in the git version.

################################################################################
#
# libgpiod
#
################################################################################

LIBGPIOD_VERSION = 0.3.2
LIBGPIOD_SOURCE = libgpiod-$(LIBGPIOD_VERSION).tar.xz
LIBGPIOD_SITE = https://www.kernel.org/pub/software/libs/libgpiod
LIBGPIOD_LICENSE = LGPL-2.1+
LIBGPIOD_LICENSE_FILES = COPYING
LIBGPIOD_INSTALL_STAGING = YES
LIBGPIOD_AUTORECONF = YES
LIBGPIOD_AUTORECONF_OPTS += -I $(HOST_DIR)/usr/share/autoconf-archive

LIBGPIOD_DEPENDENCIES = host-pkgconf \
                        host-autoconf-archive

ifeq ($(BR2_PACKAGE_LIBGPIOD_TOOLS),y)
LIBGPIOD_CONF_OPTS += --enable-tools
else
LIBGPIOD_CONF_OPTS += --disable-tools
endif

ifeq ($(BR2_INSTALL_LIBSTDCPP),y)
LIBGPIOD_CONF_OPTS += --enable-bindings-cxx
endif

$(eval $(autotools-package))

from libgpiod.

brgl avatar brgl commented on August 25, 2024

@heinemml thanks! Can confirm - it builds for me with the two AUTORECONF options set.

from libgpiod.

brgl avatar brgl commented on August 25, 2024

Bindings are now built properly in buildroot and yocto.

from libgpiod.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.