casaroli opened a new pull request, #3666:
URL: https://github.com/apache/nuttx-apps/pull/3666

   ## Summary
   
   Fix the CMake build of the bundled LAME encoder for x86 simulator hosts.
   
   LAME's generated configuration enables SSE2 and AVX2 runtime-dispatch paths 
when the host compiler supports their per-function target attributes. The CMake 
`libmp3lame` target omitted the corresponding vector translation units, which 
left `sim:alsa` with unresolved symbols at link time. This change adds the 
complete vector source group only for `CONFIG_HOST_X86` and 
`CONFIG_HOST_X86_64`; non-x86 simulator hosts retain LAME's scalar 
implementation.
   
   Companion NuttX PR: link will be added after creation. It supplies the 
bundled codec header include paths required to compile `sim_offload.c`.
   
   ## Impact
   
   - New feature: **No**.
   - User adaptation: **No**.
   - Build impact: **Yes**. Fixes linking of CMake `sim:alsa` builds on x86 
hosts when LAME enables its vector dispatch.
   - Hardware impact: **No**. This is host-simulator build integration; x86 
vector routines continue to be selected only by LAME's runtime CPU dispatch.
   - Documentation impact: **No**.
   - Security impact: **No**.
   - Compatibility impact: **No**. Non-x86 hosts continue to compile and use 
the scalar LAME path.
   - Dependency: must be merged with the companion NuttX codec-header PR for a 
complete `sim:alsa` CMake fix.
   
   ## Testing
   
   Verified locally with the companion NuttX branch.
   
   - Build host: Fedora Linux 44, x86_64, GCC 16.1.1.
   - Target: `sim:alsa`, CMake/Ninja, `CONFIG_SIM_M32=y`.
   
   Before this change, after resolving the missing codec headers, the final 
link failed with unresolved LAME vector symbols:
   
   ```text
   undefined reference to `quantize_lines_xrpow_avx2'
   undefined reference to `count_bit_esc_sse2'
   ```
   
   After this change:
   
   ```sh
   cmake -B build -DBOARD_CONFIG=sim:alsa -DNXTMPDIR=OFF -GNinja
   cmake --build build -j4
   ```
   
   completed successfully and produced `nuttx.tgz`.
   
   Additional verification:
   
   ```sh
   cmake-format --check audioutils/lame/CMakeLists.txt
   git diff --check
   ```
   
   Both completed successfully.
   
   No hardware runtime test applies to this host simulator build.
   
   ## PR verification self-check
   
   - [x] This PR introduces one focused functional change.
   - [x] All required PR description fields are completed.
   - [x] The commit has a descriptive topic/body, `Signed-off-by`, and 
`Assisted-by` trailer.
   - [x] The modified CMake file passes `cmake-format` and `git diff --check`.
   - [x] This PR is ready for review.
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to