stepmania / stepmania

Advanced rhythm game for Windows, Linux and OS X. Designed for both home and arcade use.
https://www.stepmania.com/
1.84k stars 444 forks source link

compiling error #1627

Open TheBallOfAeolus opened 6 years ago

TheBallOfAeolus commented 6 years ago

First of all I would like to thank you for your work and time. I am trying to compile it for my: OS: Ubuntu 17.10 artful Kernel: x86_64 Linux 4.13.0-32-generic

And at the end I am getting the following error:

/usr/bin/ld: ../../extern/libmmmagic/linux-64bit/libmmmagic.a(mmmagic.o): relocation R_X86_64_32 against `.rodata' cannot be used when making a shared object; recompile with -fPIC
/usr/bin/ld: ../../extern/libmmmagic/linux-64bit/libmmmagic.a(minimaidhid.o): relocation R_X86_64_32 against `.rodata' cannot be used when making a shared object; recompile with -fPIC
/usr/bin/ld: ../../extern/libmmmagic/linux-64bit/libmmmagic.a(update.o): relocation R_X86_64_32 against `.rodata' cannot be used when making a shared object; recompile with -fPIC
/usr/bin/ld: final link failed: Nonrepresentable section on output
collect2: error: ld returned 1 exit status
src/CMakeFiles/StepMania.dir/build.make:10905: recipe for target '../stepmania' failed
make[2]: *** [../stepmania] Error 1
CMakeFiles/Makefile2:498: recipe for target 'src/CMakeFiles/StepMania.dir/all' failed
make[1]: *** [src/CMakeFiles/StepMania.dir/all] Error 2
Makefile:151: recipe for target 'all' failed
make: *** [all] Error 2

Any suggestion?

I've followed the commands here: https://github.com/stepmania/stepmania/wiki/Compiling-StepMania

Thanks again

kyzentun commented 6 years ago

Solved by #1623. Master needs the same solution as 5_1-new.

It's just a matter of dropping the binaries mentioned in that PR into the extern/libmmmagic/32-bit and 64-bit folders.

TheBallOfAeolus commented 6 years ago

Thank you @kyzentun It worked. Just in case someone else needs more information and step by step:

the issue rely in the missing updated libmmmagic from: https://github.com/sl1pkn07/libmmmagic

...possibly it wasn't needed, but I deleted everything and started from scratch: rm -rf stepmania/

Start again as explained in https://github.com/stepmania/stepmania/wiki/Compiling-StepMania: git clone --depth=1 https://github.com/stepmania/stepmania.git

if you want to you can use a different branch here, for example if you are looking for 5_1-new, just use the following:
git clone --depth=1 -b 5_1-new https://github.com/stepmania/stepmania.git

To use the new libmmmagic I had to delete the one present in stepmania and place the new ones:

cd stepmania/extern/
rm -fr libmmmagic/
git clone https://github.com/sl1pkn07/libmmmagic.git

Now back in stepmania folder and continue the standard process:

cd  ..
git submodule update --init
cd Build
cmake -G 'Unix Makefiles' -DCMAKE_BUILD_TYPE=Release .. && cmake ..
make -j8

Everything went just fine now. Thanks again

latot commented 6 years ago

Hi, i had this problem, i think the problem is other, now some systems use PIC to compile, so now when we compile in that systems will not work, but the sl1pkn07 repo have that versions, so we can replace it to make it work, sadly if we compile with a system without PIC we will need use the other version.....

Lucky in this comment is the source code of the binary file https://github.com/stepmania/stepmania/issues/1669#issuecomment-380188897

I think can be great replace the binary with the source and fix this from base.

I know this because i can compile fine sm some time ago, but gentoo change to use PIC globally and now fails, so testing i think that is.

Cya.

calexil commented 6 years ago

this can be closed @dguzek