[Buildroot] [PATCH v2 1/8] package/flatbuffers: build position independent code

James Hilliard james.hilliard1 at gmail.com
Wed Nov 30 01:18:03 UTC 2022


On Tue, Nov 29, 2022 at 8:42 PM James Hilliard
<james.hilliard1 at gmail.com> wrote:
>
> On Tue, Nov 29, 2022 at 5:42 PM Arnout Vandecappelle <arnout at mind.be> wrote:
> >
> >
> >
> > On 28/11/2022 18:58, James Hilliard wrote:
> > > The upcoming tensorflow-lite package requires flatbuffers to be
> > > built with position independent code.
> > >
> > > Fixes:
> > > /home/buildroot/buildroot/output/per-package/tensorflow-lite/host/bin/../lib/gcc/aarch64-buildroot-linux-gnu/11.3.0/../../../../aarch64-buildroot-linux-gnu/bin/ld: /home/buildroot/buildroot/output/per-package/tensorflow-lite/host/aarch64-buildroot-linux-gnu/sysroot/usr/lib/libflatbuffers.a(util.cpp.o): relocation R_AARCH64_ADR_PREL_PG_HI21 against symbol `_ZN11flatbuffers11CharToUpperEc' which may bind externally can not be used when making a shared object; recompile with -fPIC
> >
> >   This looks like something that would happen any time you try to link
> > flatbuffers - so it should happen for kodi as well. In that case, the patch
> > should be applied to master. Can you check if this is the case? You
> > unfortunately can't rely on autobuilders, kodi has so many dependencies that it
> > (almost?) never gets built. There were 91 configurations in 2022 that included
> > kodi [1]; all of them failed, and I think all of them failed before reaching kodi...
>
> I tried building kodi manually and ran into build issues as well, so unclear if
> this is needed for kodi, but I think it's probably safe to apply to master.

Fixed the kodi build issues:
https://patchwork.ozlabs.org/project/buildroot/patch/20221130010306.3797360-1-james.hilliard1@gmail.com/

This doesn't seem to be needed for kodi, I did verify it does not cause any
build issues for kodi so should be safe to apply to master.

>
> By the way I think all those autobuilder configs were generated by tweaking
> kconfig probability with this patch using a local override:
> https://patchwork.ozlabs.org/project/buildroot/patch/20220514214612.3221647-1-james.hilliard1@gmail.com/
>
> I think that plus shuffle mode might allow for coverage of packages with more
> dependencies, some fixes related to shuffle mode:
> https://patchwork.ozlabs.org/project/buildroot/patch/20221016193014.3384022-1-james.hilliard1@gmail.com/
> https://patchwork.ozlabs.org/project/buildroot/patch/20221019234655.1097686-1-james.hilliard1@gmail.com/
>
> >
> >   Regards,
> >   Arnout
> >
> > [1]
> > http://autobuild.buildroot.net/index.php?date%5Bfrom%5D=2022-01-01&symbols%5BBR2_PACKAGE_KODI%5D=y
> >
> >
> >
> > >
> > > Signed-off-by: James Hilliard <james.hilliard1 at gmail.com>
> > > ---
> > >   package/flatbuffers/flatbuffers.mk | 1 +
> > >   1 file changed, 1 insertion(+)
> > >
> > > diff --git a/package/flatbuffers/flatbuffers.mk b/package/flatbuffers/flatbuffers.mk
> > > index 9d286bf9e1..487d85ee1f 100644
> > > --- a/package/flatbuffers/flatbuffers.mk
> > > +++ b/package/flatbuffers/flatbuffers.mk
> > > @@ -14,6 +14,7 @@ FLATBUFFERS_DEPENDENCIES = host-flatbuffers
> > >
> > >   FLATBUFFERS_CONF_OPTS += \
> > >       -DCMAKE_CXX_FLAGS="-std=c++11" \
> > > +     -DCMAKE_POSITION_INDEPENDENT_CODE=ON \
> > >       -DFLATBUFFERS_BUILD_TESTS=OFF \
> > >       -DFLATBUFFERS_FLATC_EXECUTABLE=$(HOST_DIR)/bin/flatc
> > >



More information about the buildroot mailing list