Buildroot Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: "Yann E. MORIN" <yann.morin.1998@free.fr>
To: enki <enki@fsck.pl>
Cc: buildroot <buildroot@buildroot.org>
Subject: Re: [Buildroot] [PATCH v4 1/1] package/spirv-tools: fix build issue
Date: Mon, 6 Nov 2023 22:43:37 +0100	[thread overview]
Message-ID: <20231106214337.GA229059@scaer> (raw)
In-Reply-To: <18ba66f6ef4.c5fba63142993.3459614153541394630@fsck.pl>

Maciej, All,

On 2023-11-06 22:00 +0100, enki spake thusly:
> ---- On Mon, 06 Nov 2023 14:30:12 +0100  Yann E. MORIN  wrote --- 
>  > On 2023-11-06 14:08 +0100, Maciej Grela spake thusly:
>  > > spirv-tools requires a toolchain w/ shared libs, add flag dependency and comment.
>  > > Fixes: http://autobuild.buildroot.net/results/a1f615d2410bffb6fdacc8586761c9def05aafa9
>  > > Fixes: http://autobuild.buildroot.net/results/294ade8c9aa3d650fa5ab6cc34701c4176bc197f
>  > Sorry, but I still don't understansd how those two build failures relate
>  > to static builds.
> If you take (as an example) the config from a1f615d2410bffb6fdacc8586761c9def05aafa9, enable the C++ support and try to build you get the 
> failure caused by ld trying to do a dynamic link with a static library:
[--SNIP--]
> Enabling the shared libs and rebuilding the toolchain fixes this. In
> other words those two builds fail *both* because of missing C++ support
> as well as a static-only toolchain. It's just that the missing C++
> makes it fail early.

Here is a minimalist defconfig with static-libs:

    BR2_arm=y
    BR2_cortex_a7=y
    BR2_TOOLCHAIN_EXTERNAL=y
    BR2_TOOLCHAIN_EXTERNAL_BOOTLIN=y
    BR2_TOOLCHAIN_EXTERNAL_BOOTLIN_ARMV7_EABIHF_MUSL_BLEEDING_EDGE=y
    BR2_STATIC_LIBS=y
    BR2_PACKAGE_SPIRV_TOOLS=y

And with this, spirv-tools does build successfully;

    $ make spirv-tools-configure
    [...]
    -- The C compiler identification is GNU 13.2.0
    -- The CXX compiler identification is GNU 13.2.0
    -- Detecting C compiler ABI info
    -- Detecting C compiler ABI info - done
    -- Check for working C compiler: /home/ymorin/dev/buildroot/O/master/host/bin/arm-linux-gcc - skipped
    -- Detecting C compile features
    -- Detecting C compile features - done
    -- Detecting CXX compiler ABI info
    -- Detecting CXX compiler ABI info - done
    -- Check for working CXX compiler: /home/ymorin/dev/buildroot/O/master/host/bin/arm-linux-g++ - skipped
    -- Detecting CXX compile features
    -- Detecting CXX compile features - done
    -- Found Python3: /usr/bin/python3.8 (found version "3.8.10") found components: Interpreter
    -- Configuring done (0.4s)
    -- Generating done (0.1s)
    CMake Warning:
      Manually-specified variables were not used by the project:

        BUILD_DOC
        BUILD_DOCS
        BUILD_EXAMPLE
        BUILD_EXAMPLES
        BUILD_TEST
        BUILD_TESTING
        BUILD_TESTS

    -- Build files have been written to: /home/ymorin/dev/buildroot/O/master/build/spirv-tools-1.3.261.1

    $ make spirv-tools-build
    [...]
    [ 99%] Linking CXX static library libSPIRV-Tools-reduce.a
    [ 99%] Built target SPIRV-Tools-reduce
    [100%] Building CXX object tools/CMakeFiles/spirv-reduce.dir/util/flags.cpp.o
    [100%] Building CXX object tools/CMakeFiles/spirv-reduce.dir/reduce/reduce.cpp.o
    [100%] Building CXX object tools/CMakeFiles/spirv-reduce.dir/util/cli_consumer.cpp.o
    [100%] Linking CXX executable spirv-reduce
    [100%] Built target spirv-reduce

    $ make spirv-tools-install
    [...]
    $ file target/usr/bin/spirv-*
    target/usr/bin/spirv-as:          ELF 32-bit LSB executable, ARM, EABI5 version 1 (SYSV), statically linked, with debug_info, not stripped
    target/usr/bin/spirv-cfg:         ELF 32-bit LSB executable, ARM, EABI5 version 1 (SYSV), statically linked, with debug_info, not stripped
    target/usr/bin/spirv-dis:         ELF 32-bit LSB executable, ARM, EABI5 version 1 (SYSV), statically linked, with debug_info, not stripped
    target/usr/bin/spirv-lesspipe.sh: a /usr/bin/env sh script, ASCII text executable
    target/usr/bin/spirv-link:        ELF 32-bit LSB executable, ARM, EABI5 version 1 (SYSV), statically linked, with debug_info, not stripped
    target/usr/bin/spirv-lint:        ELF 32-bit LSB executable, ARM, EABI5 version 1 (SYSV), statically linked, with debug_info, not stripped
    target/usr/bin/spirv-objdump:     ELF 32-bit LSB executable, ARM, EABI5 version 1 (SYSV), statically linked, with debug_info, not stripped
    target/usr/bin/spirv-opt:         ELF 32-bit LSB executable, ARM, EABI5 version 1 (SYSV), statically linked, with debug_info, not stripped
    target/usr/bin/spirv-reduce:      ELF 32-bit LSB executable, ARM, EABI5 version 1 (SYSV), statically linked, with debug_info, not stripped
    target/usr/bin/spirv-val:         ELF 32-bit LSB executable, ARM, EABI5 version 1 (SYSV), statically linked, with debug_info, not stripped

So, strictly speaking, spirv-tools do not require shared libs, and do
build OK with static-only.

So, if there is an issue with static-only, there is a hidden condition
as well. Can you investigate a bit further, please?

Regards,
Yann E. MORIN.

-- 
.-----------------.--------------------.------------------.--------------------.
|  Yann E. MORIN  | Real-Time Embedded | /"\ ASCII RIBBON | Erics' conspiracy: |
| +33 662 376 056 | Software  Designer | \ / CAMPAIGN     |  ___               |
| +33 561 099 427 `------------.-------:  X  AGAINST      |  \e/  There is no  |
| http://ymorin.is-a-geek.org/ | _/*\_ | / \ HTML MAIL    |   v   conspiracy.  |
'------------------------------^-------^------------------^--------------------'
_______________________________________________
buildroot mailing list
buildroot@buildroot.org
https://lists.buildroot.org/mailman/listinfo/buildroot

      reply	other threads:[~2023-11-06 21:43 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-10-27  9:15 [Buildroot] [PATCH v2 1/1] package/spirv-tools: fix build issue Maciej Grela
2023-10-28 22:13 ` Yann E. MORIN
2023-10-30 13:23 ` enki
2023-10-30 13:28   ` [Buildroot] [PATCH v3 " Maciej Grela
2023-11-04 13:35     ` Thomas Petazzoni via buildroot
2023-11-05 19:40       ` [Buildroot] [PATCH v4 " Maciej Grela
2023-11-05 19:45       ` [Buildroot] [PATCH v3 " enki
2023-11-06  7:48         ` Thomas Petazzoni via buildroot
2023-11-06 13:08           ` [Buildroot] [PATCH v4 " Maciej Grela
2023-11-06 13:30             ` Yann E. MORIN
2023-11-06 21:00               ` enki
2023-11-06 21:43                 ` Yann E. MORIN [this message]

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=20231106214337.GA229059@scaer \
    --to=yann.morin.1998@free.fr \
    --cc=buildroot@buildroot.org \
    --cc=enki@fsck.pl \
    /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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox