Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Trouble building on Debian 8: no symbol #14

Closed
mdeguzis opened this issue Jul 8, 2016 · 7 comments
Closed

Trouble building on Debian 8: no symbol #14

mdeguzis opened this issue Jul 8, 2016 · 7 comments
Labels

Comments

@mdeguzis
Copy link

mdeguzis commented Jul 8, 2016

Not sure what this means at the moment.

output:

   debian/rules override_dh_auto_build
make[1]: Entering directory '/build/nfs2se-1.0.0+git+bsos'
# build
cd src/ && gcc -Wall -m32 -O2 -mno-sse2 -mno-sse -mno-mmx -DSTACK_REALIGN -c *.c && \
ld -m elf_i386 -dynamic-linker /lib/ld-linux.so.2 -o "../Need For Speed II SE/nfs2se" \
*.o game-obj/NFS2SE.Linux.o -L/usr/lib -lc -lSDL2 -lGL -s -rpath=$ORIGIN -e start
game-obj/NFS2SE.Linux.o: In function `no symbol':
NFS2SE.asm:(.text+0x748a): undefined reference to `time_wrap'
NFS2SE.asm:(.text+0x749d): undefined reference to `time_wrap'
NFS2SE.asm:(.text+0x1c4b6): undefined reference to `SDL_GetTicks_wrap'
NFS2SE.asm:(.text+0x1c509): undefined reference to `SDL_GetTicks_wrap'
NFS2SE.asm:(.text+0x229d5): undefined reference to `fclose_wrap'
NFS2SE.asm:(.text+0x22aa1): undefined reference to `fscanf_wrap'
NFS2SE.asm:(.text+0x22ab2): undefined reference to `fscanf_wrap'
NFS2SE.asm:(.text+0x22ac3): undefined reference to `fscanf_wrap'
NFS2SE.asm:(.text+0x22ad4): undefined reference to `fscanf_wrap'
NFS2SE.asm:(.text+0x22ae5): undefined reference to `fscanf_wrap'
game-obj/NFS2SE.Linux.o:NFS2SE.asm:(.text+0x22afa): more undefined references to `fscanf_wrap' follow
game-obj/NFS2SE.Linux.o: In function `no symbol':
NFS2SE.asm:(.text+0x70867): undefined reference to `SDL_NumJoysticks_wrap'
NFS2SE.asm:(.text+0x708a9): undefined reference to `SDL_NumJoysticks_wrap'
NFS2SE.asm:(.text+0x7a895): undefined reference to `SDL_GetTicks_wrap'
NFS2SE.asm:(.text+0x7a8c8): undefined reference to `SDL_GetTicks_wrap'
NFS2SE.asm:(.text+0x7ac42): undefined reference to `SDL_GetTicks_wrap'
NFS2SE.asm:(.text+0x7ac5d): undefined reference to `SDL_GetTicks_wrap'
NFS2SE.asm:(.text+0x7ca31): undefined reference to `vsprintf_wrap'
NFS2SE.asm:(.text+0x7e4f1): undefined reference to `iSNDdirectsetfunctions_wrap'
NFS2SE.asm:(.text+0x7f556): undefined reference to `SDL_Delay_wrap'
NFS2SE.asm:(.text+0x7f5a5): undefined reference to `SDL_Delay_wrap'
NFS2SE.asm:(.text+0x82b86): undefined reference to `SDL_GetTicks_wrap'
NFS2SE.asm:(.text+0x82c23): undefined reference to `SDL_GetTicks_wrap'
NFS2SE.asm:(.text+0x82d15): undefined reference to `SDL_GetTicks_wrap'
NFS2SE.asm:(.text+0x82da7): undefined reference to `SDL_GetTicks_wrap'
NFS2SE.asm:(.text+0x84c26): undefined reference to `SDL_GetTicks_wrap'
game-obj/NFS2SE.Linux.o:NFS2SE.asm:(.text+0x84d50): more undefined references to `SDL_GetTicks_wrap' follow
game-obj/NFS2SE.Linux.o: In function `no symbol':
NFS2SE.asm:(.text+0x8bfcd): undefined reference to `calloc_wrap'
NFS2SE.asm:(.text+0x8eaf2): undefined reference to `SDL_GetTicks_wrap'
NFS2SE.asm:(.text+0x8ed8a): undefined reference to `vsprintf_wrap'
NFS2SE.asm:(.text+0x90d6c): undefined reference to `malloc_wrap'
NFS2SE.asm:(.text+0x9362a): undefined reference to `free_wrap'
debian/rules:13: recipe for target 'override_dh_auto_build' failed
make[1]: *** [override_dh_auto_build] Error 1
@zaps166
Copy link
Owner

zaps166 commented Jul 8, 2016

I don't know.

Now checked and works perfectly, hmm...

Do you have 32-bit SLD2 and GLIBC? Does /lib and /usr/lib are 32-bit libraries directories? Does your gcc and ld are able to generate 32-bit binaries? Maybe reorder object files: game-obj/NFS2SE.Linux.o *.o Also check this:

$ md5sum src/game-obj/NFS2SE.Linux.o 
2cfb2b1c50f86dc5b49c82c5eb10514f  src/game-obj/NFS2SE.Linux.o

@mdeguzis
Copy link
Author

mdeguzis commented Jul 9, 2016

root@debian-testing:/build/nfs2se-1.0.0+git+bsos# md5sum src/game-obj/NFS2SE.Linux.o 
2cfb2b1c50f86dc5b49c82c5eb10514f  src/game-obj/NFS2SE.Linux.o

I have the following packages in debian/control:

gcc:i386,
libsdl2-dev:i386

This also means any packages pulled in as dependencies of those. Same error if reordering. I tried correcting the path to /usr/lib/i386-linux-gnu/, no luck either. Still looking at things. I don't have paths you have hard-coded in linker steps, maybe that's it? I am building this in a i386 chroot. I read this thread about ordering the objects/linkering.

/lib/ld-linux.so.2

root@debian-testing:/build/nfs2se-1.0.0+git+bsos# file /usr/bin/ld
/usr/bin/ld: symbolic link to ld.bfd
root@debian-testing:/build/nfs2se-1.0.0+git+bsos# file /usr/bin/ld.bfd
/usr/bin/ld.bfd: ELF 32-bit LSB executable, Intel 80386, version 1 (SYSV), dynamically linked, interpreter /lib/ld-linux.so.2, for GNU/Linux 2.6.32, BuildID[sha1]=209b2d19f2a7282cf72373e0d7243d528937892f, stripped

@mdeguzis
Copy link
Author

mdeguzis commented Jul 9, 2016

I think this was my fault. I was using build steps in debian/rules from your master branch file, and I was using the v1.0.0 release...I'm sorry about that. I saw you made a lot of changes since then. On to the next steps! Can't wait to script the install further to get this prepped for my SteamOS repository.

@mdeguzis mdeguzis closed this as completed Jul 9, 2016
@mdeguzis
Copy link
Author

mdeguzis commented Jul 9, 2016

Thing that makes the rest of packaging this rough, is the Need For Speed II SE directory having spaces. Is there a reason why it has to be this way? is it hardcoded?

@mdeguzis
Copy link
Author

mdeguzis commented Jul 9, 2016

Came up with a hack, since dh_install for Debian hates spaces in the install file. See here for more. SO what I did, was rename the folder at the end of the compile/link, added dashes, then used the install file with the dashes in the name. Added a postinst file that fires off after the user installs the deb package, which renames it back. On to the next stage :)

@zaps166 zaps166 added the invalid label Jul 9, 2016
@zaps166
Copy link
Owner

zaps166 commented Jul 9, 2016

Hmm, v1.0.0 and master differs too much. I think I'll release it soon.

Thing that makes the rest of packaging this rough, is the Need For Speed II SE directory having spaces. Is there a reason why it has to be this way? is it hardcoded?

You can change the directory name after compilation or modify the compilation script :)

@mdeguzis
Copy link
Author

mdeguzis commented Jul 9, 2016

Ok, as long as the game will actually function with the directory name different, that is fine. I may just rename it and lowercase it after the compile/link. Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants