Standard C and C++ Libraries and header files

6 posts / 0 new
Last post
apcameron
apcameron's picture
Offline
Joined: 29 Jun 2010
Posts:
Standard C and C++ Libraries and header files

What are the plans to port the Standard C and C++ Libraries and Header files to Mosync?

Having them available would make is much easier to Port software including Open Source software.

Currently it is not easy to port sofware as many of the standard C library functions as not
avaiable and we have to write them from scratch ourselves.

Comment viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.
sikamedia
sikamedia's picture
Offline
Mobile Conjurer
Joined: 23 Jun 2010
Posts:

It would be nice to support As much as possible (vote for it).

apcameron
apcameron's picture
Offline
Joined: 29 Jun 2010
Posts:

Looking at the nightly builds there seems to be include files and library files called newlib which may implement many of the standard Libraries.

Is this fully functional yet and if so how should it be used?

Fredrik Eldh
Fredrik's picture
Offline
Mobile Sorcerer
Joined: 16 Feb 2009
Posts:

Our newlib port should contain pretty much all of the standard C library. However, it is experimental, and a little tricky to use.

In Eclipse, Project Properties, Build Settings, Paths and Files:
Check all three "Ignore default" boxes.
Then add /mosync/include/newlib/, /mosync/lib/newlib_release/ (or newlib_debug) and newlib.lib to their respective textboxes.

apcameron
apcameron's picture
Offline
Joined: 29 Jun 2010
Posts:

While I can get my program to compile cleanly using newlib it fails to link as some of the functions it needs do not
seem to have been added to newlib yet.

Here is what I get
c:\MoSync\bin\xgcc.exe -o C:\MoSync\workspace\test\Output\Release\sqlite.s -S -g -MMD -MF C:\MoSync\workspace\test\Output\Release\sqlite.s.deps -DMAPIP -O2 C:\MoSync\workspace\test\sqlite.c -Ic:\MoSync\profiles\vendors\MoSync\Emulator -IC:\Mosync\include\newlib -IC:\MoSync\workspace\test\Output\Release
--> GCC PIPIL Compiler v2:11:50:55:Aug 26 2009 (O2)
c:\MoSync\bin\xgcc.exe -o C:\MoSync\workspace\test\Output\Release\main.s -S -g -MMD -MF C:\MoSync\workspace\test\Output\Release\main.s.deps -DMAPIP -O2 C:\MoSync\workspace\test\main.c -Ic:\MoSync\profiles\vendors\MoSync\Emulator -IC:\Mosync\include\newlib -IC:\MoSync\workspace\test\Output\Release
--> GCC PIPIL Compiler v2:11:50:55:Aug 26 2009 (O2)
c:\MoSync\bin\pipe-tool.exe -appcode=CYQJ -stabs=stabs.tab -sld=sld.tab -sC:\Mosync\lib\newlib_release -B C:\MoSync\workspace\test\Output\Release\program C:\MoSync\workspace\test\Output\Release\sqlite.s C:\MoSync\workspace\test\Output\Release\main.s newlib.lib
pipe-tool Copyright 2007-2009 Mobile Sorcery AB
pass 1. 94 known symbols.
pass 2. 33075 known symbols.
C:\MoSync\workspace\test\sqlite.c:23201: Error: Unresolved symbol '_fcntl',
C:\MoSync\workspace\test\sqlite.c:23434: Error: Unresolved symbol '_fcntl',
C:\MoSync\workspace\test\sqlite.c:23362: Error: Unresolved symbol '_fcntl',
C:\MoSync\workspace\test\sqlite.c:23384: Error: Unresolved symbol '_fcntl',
C:\MoSync\workspace\test\sqlite.c:23391: Error: Unresolved symbol '_fcntl',
C:\MoSync\workspace\test\sqlite.c:23645: Error: Unresolved symbol '_fcntl',
C:\MoSync\workspace\test\sqlite.c:23631: Error: Unresolved symbol '_fcntl',
C:\MoSync\workspace\test\sqlite.c:23671: Error: Unresolved symbol '_fcntl',
C:\MoSync\workspace\test\sqlite.c:23886: Error: Unresolved symbol '_access',
C:\MoSync\workspace\test\sqlite.c:23934: Error: Unresolved symbol '_utimes',
C:\MoSync\workspace\test\sqlite.c:25221: Error: Unresolved symbol '_fsync',
C:\MoSync\workspace\test\sqlite.c:25313: Error: Unresolved symbol '_ftruncate',
C:\MoSync\workspace\test\sqlite.c:25899: Error: Unresolved symbol '_fcntl',
C:\MoSync\workspace\test\sqlite.c:25899: Error: Unresolved symbol '_fcntl',
C:\MoSync\workspace\test\sqlite.c:26308: Error: Unresolved symbol '_fsync',
C:\MoSync\workspace\test\sqlite.c:26355: Error: Unresolved symbol '_access',
C:\MoSync\workspace\test\sqlite.c:26391: Error: Unresolved symbol '_getcwd',
C:\MoSync\workspace\test\sqlite.c:26528: Error: Unresolved symbol '_sleep',
C:\MoSync\workspace\test\sqlite.c:26209: Error: Unresolved symbol '_fcntl',
C:\MoSync\workspace\test\sqlite.c:26209: Error: Unresolved symbol '_fcntl',
C:\MoSync\workspace\test\sqlite.c:25945: Error: Unresolved symbol '_access',
C:\MoSync\workspace\test\sqlite.c:25965: Error: Unresolved symbol '_access',

Fredrik Eldh
Fredrik's picture
Offline
Mobile Sorcerer
Joined: 16 Feb 2009
Posts:

These functions are libc syscalls, and would need to be implemented using MoSync syscalls. However, most of them can't actually do anything in MoSync, so their implementations would have to be near-empty stubs.

We don't have time to implement them at the moment, but if you'd like to help, you can do it yourself. Documentation for the functions can be found here: http://opengroup.org/onlinepubs/007908799/index.html.