Problems installing packages which use SDL2 via cgo on Windows 7 - go

I have problems installing SDL2 for golang, using Visual Studio Code.
I try to get the package:
"C:\Users\Bob\go\src\flappyGopher>go get -v github.com/veandco/go-sdl2/sdl
github.com/veandco/go-sdl2/sdl
# github.com/veandco/go-sdl2/sdl
In file included from ..\github.com\veandco\go-sdl2\sdl\audio.go:4:0:
./sdl_wrapper.h:2:23: fatal error: SDL2/SDL.h: No such file or directory
compilation terminated."
I used this manual: https://github.com/vinzBad/go-sdl2-tut/blob/master/00_preparation/windows.md
I have also the env variables:
CGO_CFLAGS C:\MinGW64\mingw64\include
GOPATH C:\Users\Bob\go
GOROOT C:\Go\
PATH ... C:\MinGW64\mingw64\x86_64-w64-mingw32\bin;C:\MinGW64\mingw64\bin;C:\Users\Bob\Downloads\SDL2-2.0.8\x86_64-w64-mingw32\include\SDL2
edit:the gcc output looks like a mess
C:\Users\Bob>gcc -xc -E -v -
Using built-in specs.
COLLECT_GCC=gcc
Target: x86_64-w64-mingw32
Configured with: ../../../src/gcc-5.1.0/configure --build=x86_64-w64- mingw32 --e
nable-targets=all --enable-languages=ada,c,c++,fortran,lto,objc,obj-c++ --enable
-libgomp --enable-lto --enable-graphite --enable-cxx-flags=-DWINPTHREAD_STATIC -
-disable-build-with-cxx --disable-build-poststage1-with-cxx --enable-libstdcxx-d
ebug --enable-threads=posix --enable-version-specific-runtime-libs --enable-full
y-dynamic-string --enable-libstdcxx-threads --enable-libstdcxx-time --with-gnu-l
d --disable-werror --disable-nls --disable-win32-registry --prefix=/mingw64tdm -
-with-local-prefix=/mingw64tdm --with-pkgversion=tdm64-1 --with-bugurl=http://td
m-gcc.tdragon.net/bugs
Thread model: posix
gcc version 5.1.0 (tdm64-1)
COLLECT_GCC_OPTIONS='-E' '-v' '-mtune=generic' '-march=x86-64'
C:/Program Files/TDM-GCC-64/bin/../libexec/gcc/x86_64-w64-mingw32/5.1.0/cc1.exe
-E -quiet -v -iprefix C:/Program Files/TDM-GCC-64/bin/../lib/gcc/x86_64-w64-min
gw32/5.1.0/ -D_REENTRANT - -mtune=generic -march=x86-64
ignoring duplicate directory "C:/Program Files/TDM-GCC-64/lib/gcc/../../lib/gcc/
x86_64-w64-mingw32/5.1.0/include"
ignoring duplicate directory "C:/Program Files/TDM-GCC-64/lib/gcc/../../lib/gcc/
x86_64-w64-mingw32/5.1.0/../../../../include"
ignoring duplicate directory "C:/Program Files/TDM-GCC-64/lib/gcc/../../lib/gcc/
x86_64-w64-mingw32/5.1.0/include-fixed"
ignoring duplicate directory "C:/Program Files/TDM-GCC-64/lib/gcc/../../lib/gcc/
x86_64-w64-mingw32/5.1.0/../../../../x86_64-w64-mingw32/include"
#include "..." search starts here:
#include <...> search starts here:
C:/Program Files/TDM-GCC-64/bin/../lib/gcc/x86_64-w64-mingw32/5.1.0/include
C:/Program Files/TDM-GCC-64/bin/../lib/gcc/x86_64-w64-mingw32/5.1.0/../../../..
/include
C:/Program Files/TDM-GCC-64/bin/../lib/gcc/x86_64-w64-mingw32/5.1.0/include-fixed
C:/Program Files/TDM-GCC-64/bin/../lib/gcc/x86_64-w64-mingw32/5.1.0/../../../..
/x86_64-w64-mingw32/include
End of search list.

Please see this.
The reason is go install tried to compile some
cgo
code of the github.com\veandco\go-sdl2 package, and that code apparently
wants to use the C header files
of the libsdl2 library¹.
You need to make libsdl2
available to the compiler.
To figure out where the C compiler expects to find the include (header)
files, see this.
¹ That's how C works. To use a compiled library in other C code, the compiler
usually needs to know the definitions of the types and functions provided
by that library. The formats of such libraries—contrary to Go libraries—do not typically embed type information in their metadata, so the compiler
needs to get that information from somewhere. In C and C++ world this information is commonly kept in the so-called include (also: header) files
which are included—through the use of a so-called preprocessor—both into the
code used to build a library and the code which uses the library.

Related

Custom built gcc 4.6.3 and gcc 5.4.0 include search list differs

I need to build some old gcc versions on Ubuntu 16. Primary goal is 4.6.3, but seems I have an include search list issue.
Builds using this compiler fail because sys/cdefs.h cannot be found. I have checked the include search paths for the compiler:
$ gcc -xc -E -v -
<…stripped…>
#include <...> search starts here:
<company specific path>/include
/usr/local/include
<company specific path>/include-fixed
/usr/include
End of search list.
I have also built gcc 5.4.0 with exactly the same build options. The search path looks like this for this version:
$ gcc -xc -E -v -
<…stripped…>
#include <...> search starts here:
<company specific path>/include
<company specific path>/include-fixed
/usr/local/include
/usr/include/x86_64-linux-gnu
/usr/include
End of search list.
Obviously the difference is /usr/include/x86_64-linux-gnu what is only present for 5.4.0. This is the dir where sys/cdefs.h resides.
Does anyone have any pointer what makes this difference? How could I build the 4.6.3 compiler to also have this path in the include search list?
I am of course aware of flags and env variables I can use to add this directory to the search path when using the compiler, but my goal would be to include this path in the compiler "hardcoded", so no additional -I and such flags should be used.
My gcc config options are:
configure --prefix=<company specific path>/gcc/4.6.3 --with-arch-32=i686
--with-sysroot=/ --with-multilib-list=m32,m64,mx32 --with-system-zlib
--enable-checking=release --build=x86_64-linux-gnu --enable-multilib
--enable-languages=c,c++,fortran
--with-as=<company specific path>/gcc/4.6.3/bin/as
--with-ld=<company specific path>/gcc/4.6.3/bin/ld
--with-gnu-as --with-gnu-ld

How to use cmake to let command "pkg_check_modules" be passed in Windows with git-bash

I want to build nss-pem on Windows by cmake with git-bash(or msys or cygwin). cmake found pkg-config in my cygwin's bin directory. I also added the directory path into PKG_CONFIG_PATH, and added .pc file and built-nss-lib into the directory I added. But I still got error when cmake exe the line pkg_check_modules(NSS REQUIRED "nss")
$PKG_CONFIG_PATH:
User#host MINGW64 ~/Desktop/nss-pem/build
$ echo $PKG_CONFIG_PATH
/mingw64/lib/pkgconfig:/mingw64/share/pkgconfig
CMake Error:
User#host MINGW64 ~/Desktop/nss-pem/build
$ cmake ../src
-- Checking for module 'nss'
-- No package 'nss' found
CMake Error at C:/Program Files/CMake/share/cmake-3.9/Modules/FindPkgConfig.cmake:412 (message):
A required package was not found
Call Stack (most recent call first):
C:/Program Files/CMake/share/cmake-3.9/Modules/FindPkgConfig.cmake:588 (_pkg_check_modules_internal)
CMakeLists.txt:7 (pkg_check_modules)
nss.pc:
# nss pkg-config
prefix=D:/Projects/library/nss
exec_prefix=${prefix}
includedir=${prefix}
libdir=${exec_prefix}/WIN954.0_x86_64_64_OPT.OBJ/lib/
Name: nss
Description: The nss library
Version: 3.32
Cflags: -I${includedir}/WIN954.0_x86_64_64_OPT.OBJ/include -I${includedir}/public/nss
Libs: -L${libdir} -lnss3 -lnspr4
What is the correct way to build this project? And what is the best way to setup the unix-like environment to build projects on Windows?
 
Update
I try to use git-bash and add cygwin/bin into my env variables. The command I used to call cmake is cmake -G "MSYS Makefiles" ../src. It seems that it occur some errors of path.
$ cmake -G "MSYS Makefiles" ../src
-- The C compiler identification is GNU 5.4.0
-- Check for working C compiler: C:/cygwin/bin/gcc.exe
-- Check for working C compiler: C:/cygwin/bin/gcc.exe -- broken
CMake Error at C:/Program Files/CMake/share/cmake-3.9/Modules/CMakeTestCCompiler .cmake:51 (message):
The C compiler "C:/cygwin/bin/gcc.exe" is not able to compile a simple test
program.
It fails with the following output:
Change Dir: C:/Users/User/Desktop/nss-pem/build/CMakeFiles/CMakeTmp
Run Build Command:"C:/cygwin/bin/make.exe" "cmTC_bdb42/fast"
/usr/bin/make -f CMakeFiles/cmTC_bdb42.dir/build.make
CMakeFiles/cmTC_bdb42.dir/build
make[1]: Entering directory
'/cygdrive/c/Users/User/Desktop/nss-pem/build/CMakeFiles/CMakeTmp'
/bin/sh: /C/Program Files/CMake/bin/cmake.exe: No such file or directory
make[1]: *** [CMakeFiles/cmTC_bdb42.dir/build.make:65:
CMakeFiles/cmTC_bdb42.dir/testCCompiler.c.obj] Error 127
make[1]: Leaving directory
'/cygdrive/c/Users/User/Desktop/nss-pem/build/CMakeFiles/CMakeTmp'
make: *** [Makefile:126: cmTC_bdb42/fast] Error 2
CMake will not be able to correctly generate this project.
Call Stack (most recent call first):
CMakeLists.txt:1 (project)
-- Configuring incomplete, errors occurred!
See also "C:/Users/User/Desktop/nss-pem/build/CMakeFiles/CMakeOutput.log".
See also "C:/Users/User/Desktop/nss-pem/build/CMakeFiles/CMakeError.log".
/bin/sh: /C/Program Files/CMake/bin/cmake.exe: No such file or directory: bash could not find cmake.exe, even if I modified the CMakeCache.txt. And the C compiler checking always fail. (I can manually compile the test file.)
So I gave up to work with git-bash, and turn to use Windows' cmd.exe with MinGW. Below is the steps what I done.
Clean up PATH env variables (remove cygwin's dirs).
Copy pkg-config.exe and the required dynamic libraries into MinGW/bin.
Create MinGW/lib/pkgconfig/nss.pc.
Below is the message returned:
C:\Users\IvenCJ7\Desktop\nss-pem\build>cmake -G "MinGW Makefiles" ../src
-- The C compiler identification is GNU 6.3.0
-- Check for working C compiler: C:/MinGW/bin/gcc.exe
-- Check for working C compiler: C:/MinGW/bin/gcc.exe -- works
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Detecting C compile features
-- Detecting C compile features - done
-- Found PkgConfig: C:/MinGW/bin/pkg-config.exe (found version "0.29.1")
-- Checking for module 'nss'
-- Found nss, version 3.32
-- Looking for lowkeyti.h
-- Looking for lowkeyti.h - found
-- Looking for NSSCKFWSlot_GetSlotID
-- Looking for NSSCKFWSlot_GetSlotID - not found
-- Configuring done
-- Generating done
-- Build files have been written to: C:/Users/User/Desktop/nss-pem/build
cmake still cannot find the function, NSSCKFWSlot_GetSlotID in NSS. I made sure the function is in the NSS's include headers.
Below is the information that pkg-config return to me.
$ pkg-config --cflags --libs nss
-ID:/Projects/library/nss/WIN954.0_x86_64_64_OPT.OBJ/include
-ID:/Projects/library/nss/public/nss
-LD:/Projects/library/nss/WIN954.0_x86_64_64_OPT.OBJ/lib/ -lnss3 -lnspr4

cmake error using the mingw-w64-x86_64 gcc toolchain under Windows 7 : "this program has been built without plugin support"

I have a setup with Windows 7, MSYS2, Mingw-w64-x86_64 gcc toolchain, CMake, and I am trying to build the nanomsg library.
Here is what I obtain :
$ cmake --debug-trycompile
-DCMAKE_TOOLCHAIN_FILE=../toolchain_i686-pc-mingw32.cmake -DCMAKE_INSTALL_PREFIX=/usr/x86_64-w64-mingw32 -G "MinGW Makefiles" ../nanomsg
debug trycompile on
-- The C compiler identification is GNU 4.8.2
-- Check for working C compiler: C:/mingw64/bin/x86_64-w64-mingw32-gcc.exe
-- Check for working C compiler: C:/mingw64/bin/x86_64-w64-mingw32-gcc.exe -- broken CMake Error at
C:/cmake-win32-x86/share/cmake-2.8/Modules/CMakeTestCCompiler.cmake:61
(message): The C compiler
"C:/mingw64/bin/x86_64-w64-mingw32-gcc.exe" is not able to compile a
simple test program.
It fails with the following output:
Change Dir:
C:/msys64/home/Laurent/Dev/nanomsg-build/CMakeFiles/CMakeTmp
Run Build Command:C:/mingw64/bin/mingw32-make.exe
"cmTryCompileExec910276652/fast"
C:/mingw64/bin/mingw32-make.exe -f
CMakeFiles\cmTryCompileExec910276652.dir\build.make
CMakeFiles/cmTryCompileExec910276652.dir/build
mingw32-make.exe1: Entering directory
'C:/msys64/home/Laurent/Dev/nanomsg-build/CMakeFiles/CMakeTmp'
C:\cmake-win32-x86\bin\cmake.exe -E cmake_progress_report
C:\msys64\home\Laurent\Dev\nanomsg-build\CMakeFiles\CMakeTmp\CMakeFiles
1
Building C object
CMakeFiles/cmTryCompileExec910276652.dir/testCCompiler.c.obj
C:\mingw64\bin\x86_64-w64-mingw32-gcc.exe -o
CMakeFiles\cmTryCompileExec910276652.dir\testCCompiler.c.obj -c
C:\msys64\home\Laurent\Dev\nanomsg-build\CMakeFiles\CMakeTmp\testCCompiler.c
Linking C executable cmTryCompileExec910276652.exe
C:\cmake-win32-x86\bin\cmake.exe -E cmake_link_script
CMakeFiles\cmTryCompileExec910276652.dir\link.txt --verbose=1
C:\cmake-win32-x86\bin\cmake.exe -E remove -f
CMakeFiles\cmTryCompileExec910276652.dir/objects.a
x86_64-w64-mingw32-gcc-ar cr
CMakeFiles\cmTryCompileExec910276652.dir/objects.a
#CMakeFiles\cmTryCompileExec910276652.dir\objects1.rsp
sorry - this program has been built without plugin support
CMakeFiles\cmTryCompileExec910276652.dir\build.make:91: recipe for
target 'cmTryCompileExec910276652.exe' failed
mingw32-make.exe1: * [cmTryCompileExec910276652.exe] Error 1
mingw32-make.exe1: Leaving directory
'C:/msys64/home/Laurent/Dev/nanomsg-build/CMakeFiles/CMakeTmp'
Makefile:116: recipe for target 'cmTryCompileExec910276652/fast'
failed
mingw32-make.exe: * [cmTryCompileExec910276652/fast] Error 2
CMake will not be able to correctly generate this project. Call
Stack (most recent call first): CMakeLists.txt:29 (project)
Here is my toolchain file:
$ cat ../toolchain_i686-pc-mingw32.cmake
# http://www.cmake.org/Wiki/CMake_Cross_Compiling#The_toolchain_file
# http://bulletphysics.org/Bullet/phpBB3/viewtopic.php?t=8959
# http://stackoverflow.com/questions/19754316/cross-compiling-opencv-with-mingw-using-cmakein-linux-for-windows
# this one is important
SET(CMAKE_SYSTEM_NAME Windows)
#this one not so much
#SET(CMAKE_SYSTEM_VERSION 1)
# specify the cross compiler
SET(PREFIX x86_64-w64-mingw32)
SET(CMAKE_MAKE_PROGRAM mingw32-make)
SET(CMAKE_C_COMPILER ${PREFIX}-gcc)
SET(CMAKE_CXX_COMPILER ${PREFIX}-g++)
SET(CMAKE_AR ${PREFIX}-gcc-ar)
SET(CMAKE_NM ${PREFIX}-gcc-nm)
SET(CMAKE_RC_COMPILER windres)
# specify the cross linker
SET(CMAKE_RANLIB ${PREFIX}-gcc-ranlib)
# where is the target environment
SET(CMAKE_FIND_ROOT_PATH /opt/mingw64 /usr/${PREFIX})
# search for programs in the build host directories
#SET(CMAKE_FIND_ROOT_PATH_MODE_PROGRAM NEVER)
# for libraries and headers in the target directories
#SET(CMAKE_FIND_ROOT_PATH_MODE_LIBRARY ONLY)
#SET(CMAKE_FIND_ROOT_PATH_MODE_INCLUDE ONLY)
It looks like it fails to build on an auto test because the toolchain misses plugin support.
Here is my gcc version and options:
$ /opt/mingw64/bin/x86_64-w64-mingw32-gcc.exe -v
Using built-in specs.
COLLECT_GCC=C:\mingw64\bin\x86_64-w64-mingw32-gcc.exe
COLLECT_LTO_WRAPPER=C:/mingw64/bin/../libexec/gcc/x86_64-w64-mingw32/4.8.2/lto-wrapper.exe
Target: x86_64-w64-mingw32
Configured with: ../../../src/gcc-4.8.2/configure --host=x86_64-w64-mingw32 --build=x86_64-w64-mingw32 --target=x86_64-w64-mingw32 --prefix=/mingw64 --with-sysroot=/c/mingw482/x86_64-482-posix-seh-rt_v3-rev3/mingw64 --with-gxx-include-dir=/mingw64/x86_64-w64-mingw32/include/c++ --enable-shared --enable-static --disable-multilib --enable-languages=ada,c,c++,fortran,objc,obj-c++,lto --enable-libstdcxx-time=yes --enable-threads=posix --enable-libgomp --enable-libatomic --enable-lto --enable-graphite --enable-checking=release --enable-fully-dynamic-string --enable-version-specific-runtime-libs --disable-isl-version-check --disable-cloog-version-check --disable-libstdcxx-pch --disable-libstdcxx-debug --enable-bootstrap --disable-rpath --disable-win32-registry --disable-nls --disable-werror --disable-symvers --with-gnu-as --with-gnu-ld --with-arch=nocona --with-tune=core2 --with-libiconv --with-system-zlib --with-gmp=/c/mingw482/prerequisites/x86_64-w64-mingw32-static --with-mpfr=/c/mingw482/prerequisites/x86_64-w64-mingw32-static --with-mpc=/c/mingw482/prerequisites/x86_64-w64-mingw32-static --with-isl=/c/mingw482/prerequisites/x86_64-w64-mingw32-static --with-cloog=/c/mingw482/prerequisites/x86_64-w64-mingw32-static --enable-cloog-backend=isl --with-pkgversion='x86_64-posix-seh-rev3, Built by MinGW-W64 project' --with-bugurl=http://sourceforge.net/projects/mingw-w64 CFLAGS='-O2 -pipe -I/c/mingw482/x86_64-482-posix-seh-rt_v3-rev3/mingw64/opt/include -I/c/mingw482/prerequisites/x86_64-zlib-static/include -I/c/mingw482/prerequisites/x86_64-w64-mingw32-static/include' CXXFLAGS='-O2 -pipe -I/c/mingw482/x86_64-482-posix-seh-rt_v3-rev3/mingw64/opt/include -I/c/mingw482/prerequisites/x86_64-zlib-static/include -I/c/mingw482/prerequisites/x86_64-w64-mingw32-static/include' CPPFLAGS= LDFLAGS='-pipe -L/c/mingw482/x86_64-482-posix-seh-rt_v3-rev3/mingw64/opt/lib -L/c/mingw482/prerequisites/x86_64-zlib-static/lib -L/c/mingw482/prerequisites/x86_64-w64-mingw32-static/lib '
Thread model: posix
gcc version 4.8.2 (x86_64-posix-seh-rev3, Built by MinGW-W64 project)
Is it related to the "--enable-plugin" option (missing in my gcc) ?
Is there somewhere a toolchain build available with this option set ? I looked for it in MSYS2, Mingw-w64, rubenvb repositories, but it is not there. Or shall I build it myself ?
Possibly nanomsg does not need it ? Does the autotest requires it because nanomsg needs it ? Or can I prevent this autotest from being run ? Or can I set something to avoid the need of the "--enable-plugins" option ?
I think you are using the MSYS2 shell here, and not MSYS2 itself. If you were using an up to date MSYS2 then you'd be using the following mingw-w64 x86_64 GCC:
$ pacman -Ss mingw-w64-x86_64-gcc
mingw64/mingw-w64-x86_64-gcc 4.9.1-6
$ PATH=/mingw64/bin:$PATH gcc -v
Configured with: ... --enable-lto ...
--enable-lto implies --enable-plugins which is the default now and so doesn't appear in the list.
To build nanomsg with MSYS2, install https://master-dl.sourceforge.net/project/msys2/Base/x86_64/msys2-x86_64-20141003.exe, untick "Run MSYS2 shell now" (you want a mingw-w64 shell instead). Run the mingw-w64 shell (Start->MSYS2 64Bit->MinGW-w64 Win64 Shell). From within that shell:
$ pacman -S git make mingw-w64-x86_64-cmake mingw-w64-x86_64-gcc
$ git clone https://github.com/nanomsg/nanomsg.git
$ mkdir nanomsg-build
$ cd nanomsg-build
$ cmake --debug-trycompile -DCMAKE_INSTALL_PREFIX=/usr/x86_64-w64-mingw32 -G "MSYS Makefiles" ../nanomsg
$ make install
But if you are a developer, we'd appreciate the contribution of a PKGBUILD for nanomsg

gcc to use newlib instead of glibc?

I want to use newlib instead of glibc in order to compile small static binaries. (I do not intend to cross-compile as the binaries are to be used by the same computer.) I believe that I need to compile a separate gcc for this ?
I compiled gcc:
./configure --prefix=/home/myuser/Desktop/gcc-4.4.5 --libexecdir=/home/myuser/Desktop/gcc-4.4.5 --libdir=/home/myuser/Desktop/gcc-4.4.5 --with-gxx-include-dir=/home/myuser/Desktop/gcc-4.4.5 --enable-languages=c --enable-libmudflap --disable-multilib --disable-libssp --disable-nls --with-newlib --with-gnu-as --with-gnu-ld --with-system-zlib
make
It compiled without errors but now when I try to compile a simple Hello World! program it wants to use headers from /usr instead of the path I specified above. These are some of the errors:
In file included from /home/myprogram/Desktop/myprogram.c:1:
/usr/include/stdio.h:34:21: error: stddef.h: No such file or directory
In file included from /usr/include/stdio.h:75,
from /home/myprogram/Desktop/myprogram.c:1:
/usr/include/libio.h:53:21: error: stdarg.h: No such file or directory
In file included from /usr/include/stdio.h:75,
from /home/myprogram/Desktop/myprogram.c:1:
/usr/include/libio.h:332: error: expected specifier-qualifier-list before 'size_t'
/usr/include/libio.h:364: error: expected declaration specifiers or '...' before 'size_t'
/usr/include/libio.h:373: error: expected declaration specifiers or '...' before 'size_t'
What am I doing wrong ? Is compiling a new gcc necessary or can I use my existing gcc and use newlib instead of glibc ???
You shouldn't need to rebuild gcc for this; you just need to point your existing gcc at the right things (using -I, -L etc.) and tell it not pull in the usual system stuff (using -nostdlib).
The section entitled "Shared newlib" in the newlib README file has runes for building and linking against either shared or static newlib when compiled natively.
I would strongly recommend using crosstool-ng to build your GCC toolchain. If you choose x86 followed by "bare metal" as the operating system, you can safely use newlib as a libc.
Note that newlib does not work with an operating system - that is standard things, like IO, won't work out of the box.
You have to tell the compiler where it can find the include files:
gcc -IyourDirectoryHere -IanotherDirectoryHere
-I
(that is a minus followed by a capital i as in Italy)
More details: http://gcc.gnu.org/onlinedocs/gcc-3.2.3/gcc/Directory-Options.html

Missing crt1 and crti when crosscompiling

I'am trying to build a cross compile toolchain based on GCC4.5 and newlib with gold and link-time-optimization enabled. GCC compiles fine but it did not generate the crt1.o or crti.o files. Therefore when I tries to use the compiler for building Newlib it complains with the message:
ld: error: cannot open crti.o: No such file or directory
ld: error: cannot open crtn.o: No such file or directory
ld: error: cannot find -lc
When searching for files named crt* in the directory where GCC4.5 is installed i got the following result:
find ../../../tooltarget/ -name "crt*" -print #(result modified to consume less space)
crtprec80.o, crtend.o, crtfastmath.o, crtbegin.o, crtendS.o, crtprec32.o, crtbeginS.o, crtbeginT.o, crtprec64.o
From the GCC spec's it seems like gcc needs both the crtbegin.o and the crti.o files, but only one of them is available.
*startfile:
%{!shared: %{pg|p|profile:gcrt1.o%s;pie:Scrt1.o%s;:crt1.o%s}} crti.o%s %{static:crtbeginT.o%s;shared|pie:crtbeginS.o
%s;:crtbegin.o%s}
Following is the flags i used when compiling GCC:
--prefix=${TTP}/usr --build=x86_64-pc-linux-gnu
--host=x86_64-pc-linux-gnu --target=x86_64-awn-linux-gnu
--with-gmp=${TTP}/usr --with-mpc=${TTP}/usr
--with-mpfr=${TTP}/usr --with-libelf=${TTP}/usr
--enable-languages=c --enable-lto
--disable-nls --disable-shared
--disable-multilib --disable-decimal-float
--disable-libmudflap --disable-libssp
--disable-libgomp --disable-threads
--without-headers --with-newlib
--with-build-sysroot=${TTP} --with-build-time-tools=${TTP}/usr/bin
I'm sure on if this is due to I configured GCC wrongly, or "stuff" simply do not work this way, or if the files crti.o should come from somewhere else.
Thanks in advance
Allan W. Nielsen
Some crt* files come not from the compiler, but from the C library. I suspect this is the case here for your crt1.o and crti.o.

Resources