We are currently migrating Bugzilla to GitHub issues.
Any changes made to the bug tracker now will be lost, so please do not post new bugs or make changes to them.
When we're done, all bug URLs will redirect to their equivalent location on the new bug tracker.

Bug 5138 - Latest SDL_TTF hg (b4347abd4fbc) fails to compile for Linux ARM64 (cross-compiler)
Summary: Latest SDL_TTF hg (b4347abd4fbc) fails to compile for Linux ARM64 (cross-comp...
Status: RESOLVED INVALID
Alias: None
Product: SDL_ttf
Classification: Unclassified
Component: misc (show other bugs)
Version: unspecified
Hardware: ARM Linux
: P2 normal
Assignee: Sam Lantinga
QA Contact: Sam Lantinga
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2020-05-15 10:25 UTC by Ellie
Modified: 2020-05-16 13:07 UTC (History)
1 user (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Ellie 2020-05-15 10:25:49 UTC
The latest Latest SDL_TTF hg (b4347abd4fbc) fails to compile for me when trying to compile it for Linux on ARM64 (cross-compiler):

make[3]: Entering directory '/compile-tree/vendor/SDL_ttf'
/bin/bash ./libtool  --tag=CC   --mode=compile aarch64-linux-gnu-gcc -DPACKAGE_NAME=\"\" -DPACKAGE_TARNAME=\"\" -DPACKAGE_VERSION=\"\" -DPACKAGE_STRING=\"\" -DPACKAGE_BUGREPORT=\"\" -DPACKAGE_URL=\"\" -DSTDC_HEADERS=1 -DHAVE_SYS_TYPES_H=1 -DHAVE_SYS_STAT_H=1 -DHAVE_STDLIB_H=1 -DHAVE_STRING_H=1 -DHAVE_MEMORY_H=1 -DHAVE_STRINGS_H=1 -DHAVE_INTTYPES_H=1 -DHAVE_STDINT_H=1 -DHAVE_UNISTD_H=1 -DHAVE_DLFCN_H=1 -DLT_OBJDIR=\".libs/\" -DPACKAGE=\"SDL2_ttf\" -DVERSION=\"2.0.15\" -DHAVE_ALLOCA_H=1 -DHAVE_ALLOCA=1 -DX_DISPLAY_MISSING=1 -I.     -g -O2 -I/usr/include/freetype2 -I/usr/include/libpng16 -I/usr/include/SDL2 -D_REENTRANT -MT SDL_ttf.lo -MD -MP -MF .deps/SDL_ttf.Tpo -c -o SDL_ttf.lo SDL_ttf.c
libtool: compile:  aarch64-linux-gnu-gcc -DPACKAGE_NAME=\"\" -DPACKAGE_TARNAME=\"\" -DPACKAGE_VERSION=\"\" -DPACKAGE_STRING=\"\" -DPACKAGE_BUGREPORT=\"\" -DPACKAGE_URL=\"\" -DSTDC_HEADERS=1 -DHAVE_SYS_TYPES_H=1 -DHAVE_SYS_STAT_H=1 -DHAVE_STDLIB_H=1 -DHAVE_STRING_H=1 -DHAVE_MEMORY_H=1 -DHAVE_STRINGS_H=1 -DHAVE_INTTYPES_H=1 -DHAVE_STDINT_H=1 -DHAVE_UNISTD_H=1 -DHAVE_DLFCN_H=1 -DLT_OBJDIR=\".libs/\" -DPACKAGE=\"SDL2_ttf\" -DVERSION=\"2.0.15\" -DHAVE_ALLOCA_H=1 -DHAVE_ALLOCA=1 -DX_DISPLAY_MISSING=1 -I. -g -O2 -I/usr/include/freetype2 -I/usr/include/libpng16 -I/usr/include/SDL2 -D_REENTRANT -MT SDL_ttf.lo -MD -MP -MF .deps/SDL_ttf.Tpo -c SDL_ttf.c -o SDL_ttf.o
In file included from /usr/include/SDL2/SDL.h:38:0,
                 from SDL_ttf.c:34:
/usr/include/SDL2/SDL_cpuinfo.h:64:10: fatal error: immintrin.h: No such file or directory
 #include <immintrin.h>
          ^~~~~~~~~~~~~
compilation terminated.

A few revisions back I didn't see this issue, although it failed for other reasons (used NEON in a way that apparently wasn't compatible with the toolchain and got me tons of type errors).

I built SDL2 itself before just fine with the same cross-compile toolchain, so in theory it should be working.
Comment 1 Sylvain 2020-05-15 15:30:32 UTC
Not sure, but:

It's not related to SDL_ttf since: 
SDL_ttf.c is including SDL2/SDL.h, which is including missing <immintrin.h>


You said you just build SDL2 correctly. so is this ok that you include header directly from /usr/include ?
are you missing the path to immintrin.h file ?
Comment 2 Ellie 2020-05-15 15:40:56 UTC
I actually deleted /usr/include/SDL2 and symlinked it to the SDL2 I built, to workaround SDL_TTF lacking an option to point it directly to a source tree (rather than an install) to fetch the headers. So these are the headers of the SDL2 version that I just cross-compiled before.

Now regarding the immintrin.h file, I don't have the slightest clue what that is, so I'm not sure. All I know is that SDL2 itself built, and I'm using the headers of the version where the build went ok. Maybe this could be a bug in the SDL2 headers? I'm really not sure
Comment 3 Sylvain 2020-05-15 17:58:49 UTC
immintrin.h is for intrinsics, it comes with the toolchain.

if it doesn't exist maybe SDL2 has a fallback, but that something detected at configure. Probably HAVE_IMMINTRIN_H
https://hg.libsdl.org/SDL/file/c40934185184/include/SDL_cpuinfo.h

(Your SDL2 doesn't seem to be the latest because immintrin is at line 86)


latest logs for this file:
https://hg.libsdl.org/SDL/log/c40934185184/include/SDL_cpuinfo.h
Comment 4 Ellie 2020-05-16 13:07:04 UTC
Ah yeah, I did build with 2.0.12 and not latest SDL2 hg and now this issue appears to be gone at least. (Had another one pop up, however) So that's good news! Thanks for the hint and sorry for the wasted ticket