KallistiOS/kos-ports

sh-elf-gcc: error: unrecognized command line option ‘-pthread’ when building freetype

Closed this issue · 2 comments

Doing make install in the freetype folder gives me the -pthread error each time. The kos-cc version is 9.3.0 so I am unsure why it doesn't build properly. This is the full output of make install if that helps:

Finished processing dependencies for freetype.
File "freetype-2.10.2.tar.gz" is ok.
Unpacking freetype-2.10.2.tar.gz ...
Copying KOS files...
make[1]: Entering directory '/opt/toolchains/dc/kos-ports/freetype/build/freetype-2.10.2'

FreeType build system -- automatic system detection

The following settings are used:

  platform                    unix
  compiler                    kos-cc
  configuration directory     ./builds/unix
  configuration rules         ./builds/unix/unix.mk

If this does not correspond to your system or settings please remove the file
`config.mk' from this directory then read the INSTALL file for help.

Otherwise, simply type `make' again to build the library,
or `make refdoc' to build the API reference (this needs Python >= 3.5).

Generating modules list in ./objs/ftmodule.h...
done.
* module: truetype  (Windows/Mac font files with extension *.ttf or *.ttc)
* module: type1     (Postscript font files with extension *.pfa or *.pfb)
* module: cff       (OpenType fonts with extension *.otf)
* module: cid       (Postscript CID-keyed fonts, no known extension)
* module: pfr       (PFR/TrueDoc font files with extension *.pfr)
* module: type42    (Type 42 font files with no known extension)
* module: winfnt    (Windows bitmap fonts with extension *.fnt or *.fon)
* module: pcf       (pcf bitmap fonts)
* module: bdf       (bdf bitmap fonts)
* module: sfnt      (helper module for TrueType & OpenType formats)
* module: autofit   (automatic hinting module)
* module: pshinter  (Postscript hinter module)
* module: raster    (monochrome bitmap renderer)
* module: smooth    (anti-aliased bitmap renderer)
* module: smooth    (anti-aliased bitmap renderer for LCDs)
* module: smooth    (anti-aliased bitmap renderer for vertical LCDs)
* module: psaux     (Postscript Type 1 & Type 2 helper module)
* module: psnames   (Postscript & Unicode Glyph name handling)
cd builds/unix; \
        ./configure  '--prefix=/opt/toolchains/dc/kos/../kos-ports/freetype/inst' '--host=sh-elf' '--disable-mmap' '--with-brotli=no'
checking build system type... x86_64-pc-linux-gnu
checking host system type... sh-unknown-elf
checking for sh-elf-gcc... kos-cc
checking whether the C compiler works... yes
checking for C compiler default output file name... a.out
checking for suffix of executables... 
checking whether we are cross compiling... yes
checking for suffix of object files... o
checking whether we are using the GNU C compiler... yes
checking whether kos-cc accepts -g... yes
checking for kos-cc option to accept ISO C89... none needed
checking how to run the C preprocessor... kos-cc -E
checking for sh-elf-pkg-config... no
checking for pkg-config... /usr/bin/pkg-config
configure: WARNING: using cross tools not prefixed with host triplet
checking pkg-config is at least version 0.24... yes
checking how to print strings... printf
checking for a sed that does not truncate output... /usr/bin/sed
checking for grep that handles long lines and -e... /usr/bin/grep
checking for egrep... /usr/bin/grep -E
checking for fgrep... /usr/bin/grep -F
checking for ld used by kos-cc... /opt/toolchains/dc/sh-elf/sh-elf/bin/ld
checking if the linker (/opt/toolchains/dc/sh-elf/sh-elf/bin/ld) is GNU ld... yes
checking for BSD- or MS-compatible name lister (nm)... /opt/toolchains/dc/sh-elf/bin/sh-elf-nm -B
checking the name lister (/opt/toolchains/dc/sh-elf/bin/sh-elf-nm -B) interface... BSD nm
checking whether ln -s works... yes
checking the maximum length of command line arguments... 1572864
checking how to convert x86_64-pc-linux-gnu file names to sh-unknown-elf format... func_convert_file_noop
checking how to convert x86_64-pc-linux-gnu file names to toolchain format... func_convert_file_noop
checking for /opt/toolchains/dc/sh-elf/sh-elf/bin/ld option to reload object files... -r
checking for sh-elf-objdump... sh-elf-objdump
checking how to recognize dependent libraries... unknown
checking for sh-elf-dlltool... no
checking for dlltool... no
checking how to associate runtime and link libraries... printf %s\n
checking for sh-elf-ar... sh-elf-ar
checking for archiver @FILE support... @
checking for sh-elf-strip... sh-elf-strip
checking for sh-elf-ranlib... sh-elf-ranlib
checking for gawk... gawk
checking command to parse /opt/toolchains/dc/sh-elf/bin/sh-elf-nm -B output from kos-cc object... ok
checking for sysroot... no
checking for a working dd... /usr/bin/dd
checking how to truncate binary pipes... /usr/bin/dd bs=4096 count=1
checking for sh-elf-mt... no
checking for mt... no
checking if : is a manifest tool... no
checking for ANSI C header files... yes
checking for sys/types.h... yes
checking for sys/stat.h... yes
checking for stdlib.h... yes
checking for string.h... yes
checking for memory.h... yes
checking for strings.h... yes
checking for inttypes.h... yes
checking for stdint.h... yes
checking for unistd.h... yes
checking for dlfcn.h... no
checking for objdir... .libs
checking if kos-cc supports -fno-rtti -fno-exceptions... no
checking for kos-cc option to produce PIC... -fPIC -DPIC
checking if kos-cc PIC flag -fPIC -DPIC works... yes
checking if kos-cc static flag -static works... yes
checking if kos-cc supports -c -o file.o... yes
checking if kos-cc supports -c -o file.o... (cached) yes
checking whether the kos-cc linker (/opt/toolchains/dc/sh-elf/sh-elf/bin/ld) supports shared libraries... yes
checking whether -lc should be explicitly linked in... no
checking dynamic linker characteristics... no
checking how to hardcode library paths into programs... immediate
checking whether stripping libraries is possible... yes
checking if libtool supports shared libraries... no
checking whether to build shared libraries... no
checking whether to build static libraries... yes
checking windows.h usability... no
checking windows.h presence... no
checking for windows.h... no
checking for x86_64-pc-linux-gnu-gcc... x86_64-pc-linux-gnu-gcc
checking for x86_64-pc-linux-gnu-gcc... (cached) x86_64-pc-linux-gnu-gcc
checking for x86_64-pc-linux-gnu-gcc... (cached) x86_64-pc-linux-gnu-gcc
checking for suffix of native executables... 
checking for a BSD-compatible install... /usr/bin/install -c
checking for a thread-safe mkdir -p... /usr/bin/mkdir -p
checking for ANSI C header files... (cached) yes
checking fcntl.h usability... yes
checking fcntl.h presence... yes
checking for fcntl.h... yes
checking for unistd.h... (cached) yes
checking for an ANSI C-conforming const... yes
checking size of int... 4
checking size of long... 4
checking for unsigned long long int... yes
checking for long long int... yes
checking whether cpp computation of bit length in ftconfig.in works... yes
checking for special C compiler options needed for large files... no
checking for _FILE_OFFSET_BITS value needed for large files... unknown
checking for _LARGE_FILES value needed for large files... unknown
checking for memcpy... yes
checking for memmove... yes
checking gcc compiler flag -pedantic to assure ANSI C works correctly... ok, adding to XX_ANSIFLAGS
checking gcc compiler flag -ansi to assure ANSI C works correctly... ok, adding to XX_ANSIFLAGS
checking for -fvisibility=hidden compiler flag... yes
checking for ZLIB... yes
checking for BZIP2... yes
checking for LIBPNG... yes
checking for HARFBUZZ... yes
checking for library containing clock_gettime... no
checking for python3... python3
checking for python version... 3.10.5
checking for `docwriter' Python module... no
configure: creating ./config.status
config.status: creating ftoption.h
config.status: creating unix-cc.mk
config.status: creating unix-def.mk
config.status: creating ftconfig.h
config.status: executing libtool commands
configure:

Library configuration:
  external zlib: yes (ZLIB_CFLAGS and ZLIB_LIBS)
  bzip2:         yes (BZIP2_CFLAGS and BZIP2_LIBS)
  libpng:        yes (LIBPNG_CFLAGS and LIBPNG_LIBS)
  harfbuzz:      yes (pkg-config)
  brotli:        no

configure:
  Warning: `make refdoc' will fail since pip package `docwriter' is not
  installed.  To install, run `python3 -m pip install docwriter', or to use a Python
  virtual environment, run `make refdoc-venv' (requires pip package
  `virtualenv'). These operations require Python >= 3.5.
  
make[1]: Leaving directory '/opt/toolchains/dc/kos-ports/freetype/build/freetype-2.10.2'
make[1]: Entering directory '/opt/toolchains/dc/kos-ports/freetype/build/freetype-2.10.2'
./builds/unix/libtool --mode=compile kos-cc -pedantic -ansi -I/opt/toolchains/dc/kos-ports/freetype/build/freetype-2.10.2/objs -I./builds/unix -I/opt/toolchains/dc/kos-ports/freetype/build/freetype-2.10.2/include  -c -Wall -g -O2 -fvisibility=hidden -I/opt/toolchains/dc/kos/../kos-ports/include/zlib -I/opt/toolchains/dc/kos/../kos-ports/include/bzlib -I/opt/toolchains/dc/kos/../kos-ports/include/png -std=gnu11 -I/usr/include/harfbuzz -I/usr/include/freetype2 -I/usr/include/libpng16 -I/usr/include/glib-2.0 -I/usr/lib/glib-2.0/include -I/usr/include/sysprof-4 -pthread -DFT_CONFIG_CONFIG_H="<ftconfig.h>" -DFT_CONFIG_MODULES_H="<ftmodule.h>" -DFT_CONFIG_OPTIONS_H="<ftoption.h>" -DFT2_BUILD_LIBRARY -o /opt/toolchains/dc/kos-ports/freetype/build/freetype-2.10.2/objs/ftsystem.lo /opt/toolchains/dc/kos-ports/freetype/build/freetype-2.10.2/src/base/ftsystem.c
libtool: compile:  kos-cc -pedantic -ansi -I/opt/toolchains/dc/kos-ports/freetype/build/freetype-2.10.2/objs -I./builds/unix -I/opt/toolchains/dc/kos-ports/freetype/build/freetype-2.10.2/include -c -Wall -g -O2 -fvisibility=hidden -I/opt/toolchains/dc/kos/../kos-ports/include/zlib -I/opt/toolchains/dc/kos/../kos-ports/include/bzlib -I/opt/toolchains/dc/kos/../kos-ports/include/png -std=gnu11 -I/usr/include/harfbuzz -I/usr/include/freetype2 -I/usr/include/libpng16 -I/usr/include/glib-2.0 -I/usr/lib/glib-2.0/include -I/usr/include/sysprof-4 -pthread "-DFT_CONFIG_CONFIG_H=<ftconfig.h>" "-DFT_CONFIG_MODULES_H=<ftmodule.h>" "-DFT_CONFIG_OPTIONS_H=<ftoption.h>" -DFT2_BUILD_LIBRARY /opt/toolchains/dc/kos-ports/freetype/build/freetype-2.10.2/src/base/ftsystem.c -o /opt/toolchains/dc/kos-ports/freetype/build/freetype-2.10.2/objs/ftsystem.o
sh-elf-gcc: error: unrecognized command line option ‘-pthread’
make[1]: *** [/opt/toolchains/dc/kos-ports/freetype/build/freetype-2.10.2/builds/freetype.mk:204: /opt/toolchains/dc/kos-ports/freetype/build/freetype-2.10.2/objs/ftsystem.lo] Error 1
make[1]: Leaving directory '/opt/toolchains/dc/kos-ports/freetype/build/freetype-2.10.2'
make: *** [/opt/toolchains/dc/kos/../kos-ports/scripts/build.mk:19: build-stamp] Error 2

Im not able to reproduce on my macbook Pro Monterey. Did you try going to the utils folder inside kos-ports?

/kos-ports/utils

Then run the ./build-all.sh script

Closed via PR #21.