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

Bug when building on void linux #4806

Closed
porky11 opened this issue Feb 1, 2019 · 9 comments · Fixed by #5696
Closed

Bug when building on void linux #4806

porky11 opened this issue Feb 1, 2019 · 9 comments · Fixed by #5696

Comments

@porky11
Copy link

porky11 commented Feb 1, 2019

Almost everything works as expected, but not the linking of the executable.
The error I get is this:

/usr/bin/ld: 3rdparty/rpmalloc/librpmalloc.a(rpmalloc.c.o): relocation R_X86_64_32S against `.text' can not be used when making a PIE object; recompile with -fPIC
/usr/bin/ld: final link failed: nonrepresentable section on output
collect2: error: ld returned 1 exit status
@JohannesLorenz
Copy link
Contributor

Is this even an LMMS issue?

At what stage does it happen? (We could need the full build log)

@porky11
Copy link
Author

porky11 commented Feb 3, 2019

It happens during this command, when calling make -j4:

[100%] Linking CXX executable ../lmms

I don't think, the rest of the generated output will help. It's basically just a list of what's compiled.

@PhysSong
Copy link
Member

PhysSong commented Feb 4, 2019

@porky11 Could you try this patch?

diff --git a/src/3rdparty/rpmalloc/CMakeLists.txt b/src/3rdparty/rpmalloc/CMakeLists.txt
index 23d1551c2..2d94bcdfd 100644
--- a/src/3rdparty/rpmalloc/CMakeLists.txt
+++ b/src/3rdparty/rpmalloc/CMakeLists.txt
@@ -1,5 +1,9 @@
 set(CMAKE_C_FLAGS "-std=c11")
 
+if(NOT WIN32)
+       set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -fPIC")
+endif()
+
 add_library(rpmalloc STATIC
        rpmalloc/rpmalloc/rpmalloc.c
        rpmalloc/rpmalloc/rpmalloc.h

@porky11
Copy link
Author

porky11 commented Feb 7, 2019

I found it in the repos now, so I don't need to build it myself anymore. Not sure, why I didn't see it before.

@porky11 porky11 closed this as completed Feb 7, 2019
@JohannesLorenz
Copy link
Contributor

That does not mean that the bug is fixed. Try @PhysSong 's patch or find out how the void linux packagers did build their package.

@JohannesLorenz
Copy link
Contributor

@devnexen Do you think this will also be fixed with the rpmalloc update?

@devnexen
Copy link
Contributor

devnexen commented Oct 3, 2020

Even tough I would like the update not sure it is related here, seems just a linkage issue. it seems lmms cmake to build rpmalloc rather than ninja rpmalloc build system.

JohannesLorenz added a commit to JohannesLorenz/lmms that referenced this issue Oct 3, 2020
Fixes LMMS#4752
Fixes LMMS#4806 (at least, this is what we think)
Helps LMMS#5694
JohannesLorenz added a commit to JohannesLorenz/lmms that referenced this issue Oct 4, 2020
Fixes LMMS#4752
Fixes LMMS#4806 (at least, this is what we think)
Helps LMMS#5694
JohannesLorenz added a commit that referenced this issue Oct 5, 2020
This PR updates the remote URL and content of rpmalloc.

Fixes #4752
Fixes #4806 (assumably)
Helps #5694

You must now run
```
git submodule sync --recursive
```
once to reflect this change.
@PhysSong
Copy link
Member

From Discord by @Sawuare:

I get errors while building master on Kubuntu 21.04:

[ 98%] Linking CXX executable ../lmms
/usr/bin/ld: CMakeFiles/lmmsobjs.dir/3rdparty/weakjack/weakjack/weak_libjack.c.o: relocation R_X86_64_32 against `.bss' can not be used when making a PIE object; recompile with -fPIE
/usr/bin/ld: 3rdparty/rpmalloc/librpmalloc.a(rpmalloc.c.o): relocation R_X86_64_32S against `.bss' can not be used when making a PIE object; recompile with -fPIE
collect2: error: ld returned 1 exit status
make[2]: *** [src/CMakeFiles/lmms.dir/build.make:610: lmms] Error 1
make[1]: *** [CMakeFiles/Makefile2:871: src/CMakeFiles/lmms.dir/all] Error 2
make: *** [Makefile:171: all] Error 2

Adding -fPIE to CMAKE_C_FLAGS in src/3rdparty/rpmalloc/CMakeLists.txt fixed the rpmalloc error

Looks like a related bug. Should I reopen this, or make a new bug report?

@JohannesLorenz
Copy link
Contributor

Looks like a related bug. Should I reopen this, or make a new bug report?

I'd prefer a new issue, since this one here is really old and it's not sure how it is related. You could link this issue there. But I leave it to you.

sdasda7777 pushed a commit to sdasda7777/lmms that referenced this issue Jun 28, 2022
This PR updates the remote URL and content of rpmalloc.

Fixes LMMS#4752
Fixes LMMS#4806 (assumably)
Helps LMMS#5694

You must now run
```
git submodule sync --recursive
```
once to reflect this change.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants