SDL

102 views
Skip to first unread message

Niek Vlessert

unread,
Feb 12, 2012, 5:21:11 PM2/12/12
to Native-Client-Discuss
Hello all,

I'm trying to link SDL from Naclports with pepper 15 & 16 but both give me a lot of undefined references;

__assert_func
strlcpy
_impure_ptr
__errno
pthread_cond_timedwait_abs
__ctype_ptr__

Is it true naclports SDL is not fully updated to the latest Pepper or am I doing something wrong?

Regards,

Niek

Dimitris Zenios

unread,
Feb 12, 2012, 6:02:52 PM2/12/12
to native-cli...@googlegroups.com
I have tested SDL with pepper 16 and it works perfectly

> --
> You received this message because you are subscribed to the Google Groups
> "Native-Client-Discuss" group.
> To post to this group, send email to native-cli...@googlegroups.com.
> To unsubscribe from this group, send email to
> native-client-di...@googlegroups.com.
> For more options, visit this group at
> http://groups.google.com/group/native-client-discuss?hl=en.

Egor Pasko

unread,
Feb 12, 2012, 6:06:28 PM2/12/12
to native-cli...@googlegroups.com

.. maybe you took the SDL library linked with newlib toolchain and
using it with a glibc toolchain? that is not supposed to work

--
Egor Pasko

Niek Vlessert

unread,
Feb 12, 2012, 6:08:33 PM2/12/12
to native-cli...@googlegroups.com
Hello,

That's interesting! I've been grepping for strlcpy in the libs from pepper, but couldn't find anything, got an idea?

Here's my try with pepper_17, same errors. I'm including some other stuff here, but that can't be it because it fails on SDL_error.

linker command: i686-nacl-g++ derived/x86-nacl-i686/config/SDL.o -o derived/x86-nacl-i686/config/SDL.bin -L/home/niek/src/nacl_sdk/pepper_17/toolchain/linux_x86_newlib/i686-nacl/usr/lib/ -lnosys -L/home/niek/src/nacl_sdk/pepper_17/toolchain/linux_x86_newlib/i686-nacl/usr/local/lib/ -ltcl8.6 -I/home/niek/src/nacl_sdk/pepper_17/toolchain/linux_x86_newlib/i686-nacl/usr/include/ -m32 -lSDL -lm -lppapi -lppapi_cpp -lpthread -lnosys
/home/niek/src/nacl_sdk/pepper_17/toolchain/linux_x86_newlib/i686-nacl/usr/lib//libSDL.a(SDL_systhread.o): In function `SDL_SYS_KillThread':
/home/niek/src/naclports/src/out/repository-i686/SDL-1.2.14/SDL-1.2.14-build/../src/thread/pthread/SDL_systhread.c:121: warning: warning: pthread_kill is not implemented and will always fail
/home/niek/src/nacl_sdk/pepper_17/toolchain/linux_x86/bin/../lib/gcc/x86_64-nacl/4.4.3/../../../../x86_64-nacl/lib/../lib32/libppapi_cpp.so: warning: warning: pthread_cancel is not implemented and will always fail
/home/niek/src/nacl_sdk/pepper_17/toolchain/linux_x86_newlib/i686-nacl/usr/lib//libSDL.a(SDL_error.o): In function `SDL_SetError':
/home/niek/src/naclports/src/out/repository-i686/SDL-1.2.14/SDL-1.2.14-build/../src/SDL_error.c:58: undefined reference to `strlcpy'
/home/niek/src/naclports/src/out/repository-i686/SDL-1.2.14/SDL-1.2.14-build/../src/SDL_error.c:95: undefined reference to `strlcpy'
etc...

Regards,

Niek

Niek Vlessert

unread,
Feb 12, 2012, 6:23:09 PM2/12/12
to native-cli...@googlegroups.com
No,

afaik that's not it, all the other stuff i'm using links fine. But you gave me an idea, maybe it has something to do with this newlib stuff, because I have linux_x86 in my path and linux_x86_newlib as well. Why two folders with mostly the same things?

Regards,

Niek

Egor Pasko

unread,
Feb 13, 2012, 8:30:51 AM2/13/12
to native-cli...@googlegroups.com
On Mon, Feb 13, 2012 at 3:23 AM, Niek Vlessert <niekvl...@gmail.com> wrote:
> No,
>
> afaik that's not it, all the other stuff i'm using links fine. But you gave
> me an idea, maybe it has something to do with this newlib stuff, because I
> have linux_x86 in my path and linux_x86_newlib as well. Why two folders with
> mostly the same things?

yeah, "linux_x86" contains the glibc toolchain (i.e. compiler and
libraries), the "linux_x86_newlib" contains the newlib toolchain.
Those two are generally incompatible. There are multiple differences
between those: in download size (newlib is smaller), amount of
features (glibc is more complete, easier to port existing apps), etc.
As a developer you'd need to pay attention to differences in the NaCl
manifest file for those [1].

try "x86_64-nacl-objdump -t" from toolchain to see the symbols in your
SDL library, if it contains "_impure_ptr", you can be sure, it was
linked with newlib toolchain

[1] http://www.chromium.org/nativeclient/design-documents/nacl-manifest-file-format-for-glibc

--
Egor Pasko

Niek Vlessert

unread,
Feb 14, 2012, 5:12:52 PM2/14/12
to native-cli...@googlegroups.com
Thanks a lot! I moved from newlib to no-newlib and that fixed my problems, SDL is building fine now. :)

Regards,

Niek


--
Egor Pasko

Reply all
Reply to author
Forward
0 new messages