Newlib

Discussing libraries simplifying applications development
  • esevece wrote:I don't understand how to use the newlib.
    I tried translating this thread to spanish and english but it's not accurate.

    I'll be grateful if someone can explain me in english what I have to do to use the newlib.
    Prepare 32 bit gcc which able to generate PE output; then download a-libs, ld-scripts and "include" headers. Then use "nostdinc", custom ld script and newlib a-files to generate static binaries.
  • Thank you Wildwest and SoUrcerer.

    SoUrcerer: I will try to follow your guide.
  • I'm compiling GCC and BINUTILS following this guide http://wiki.osdev.org/GCC_Cross-Compiler.
    Is right to use 'i586-mingw32' as --target?
  • If you on linux, you can just install mingw32 package. Also, there's port of binutils for Kolibri on SVN
  • Ok. Thank you.
  • Do you mean that I don't have to compile GCC?
    I've compiled binutils with the patch from the SVN and installed mingw32-gcc. But when I run `make` in 'newlib/' I get:

    Code: Select all

    gcc -c -O2 -fomit-frame-pointer -DBUILD_DLL -D_IEEE_LIBM -I ./include -o crt/crtdll.o crt/crtdll.c
    In file included from crt/crtdll.c:10:0:
    ./include/sys/kos_io.h:69:16: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘unpack’
     void __stdcall unpack(void* packed_data, void* unpacked_data);
                    ^
    make: *** [crt/crtdll.o] Error 1
    
  • I suppose if you use binutils with i586-kos32 target, then you have to port gcc too. Otherwise you need to use i586-mingw32-gcc as compiler; check lua compile.sh/link.sh scripts: download/file.php?id=3748
  • Ok, now I understand. Thank you SoUrcerer.
    I will use that scripts as reference.
  • I modified the 'Makefile' in 'newlib/' to use mingw32.
    Now I have i486-mingw32-gcc, i486-mingw32-ld, etc. But I get an error because i486-mingw32-ld doesn't find 'libc.ver'.

    Code: Select all

    i486-mingw32-ld: cannot open linker script file libc.ver: No existe el fichero o el directorio (in english: the file or directory not exist)
    
  • esevece
    fixed
  • Thank you Serge.
    I got an error about "-lgcc". So, after search I found the solution adding "-L/usr/lib/gcc/i486-mingw32/4.7.2" to the line that uses "-lgcc".

    Now I have newlib built. I will try to use newlib and if works I will create an article in the wiki.

    Thanks guys.
  • Есть вопрос.
    Надо ли включать в SDK исходные коды пакетов (freetype ffmpeg cairo libpng, zlib etc) ?
  • That question was to me?
  • esevece, no.
    to infinity and beyond
  • Who is online

    Users browsing this forum: No registered users and 3 guests