-
-
Notifications
You must be signed in to change notification settings - Fork 1.6k
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
unrecognized relocation (0x2a) in section `.text' #8653
Comments
This is to do with an old |
A related issue was raised in https://travis-ci.community/t/fails-to-link-against-libgc-a-in-crystal-0-31-0/5197/5 and solved by upgrading binutils but I think you might be in the latest available for jessie Another related issue is #8323 From the travis issue, a fix might be to ship a gc built with As a workaround is to build/link against a gc other than the one it was shipped. As long as you don't use preview_mt that should be doable with the official package. |
Aww, maybe I should just upgrade ;S. I think my server files will work on 9/10. |
I did not report to the board of Travis CI, but I have not succeeded with using gc with I have not tested (yet), but
A simple testConsidering following simple C source, with Debian 10 (via Singularity container) #include <stdio.h>
extern int foo(void);
int main(int argc, char **argv)
{
printf("%p\n", foo);
return 0;
}
|
We don't want to include PIE executables can be built and used on debian 8, it's about downgrading the toolchain version when building. |
I just noticed that the distributed binaries are not reported as PIE (but as shared library, which can be ASLR enabled). (I'm using hardening-check version 2.6, which might generate different result to Debian's)
Built binaries by Crystal compiler becomes PIE only if
For lugia@kanna:~/build/crystal-for-legacy-dist/distribution-scripts> git diff | cat
diff --git a/linux/Dockerfile b/linux/Dockerfile
index 2554704..82f219f 100644
--- a/linux/Dockerfile
+++ b/linux/Dockerfile
@@ -4,11 +4,12 @@ FROM ${debian_image} AS debian
RUN echo "deb http://deb.debian.org/debian buster-backports main" >> /etc/apt/sources.list \
&& apt-get update \
- && apt-get install -y -t buster-backports build-essential libevent-dev libpcre3-dev automake libtool pkg-config git curl llvm-8 \
+ && apt-get install -y -t buster-backports build-essential libevent-dev libpcre3-dev automake libtool pkg-config git curl llvm-8 clang-8 \
&& (pkg-config || true)
ARG release
-ENV CFLAGS="-fPIC -pipe ${release:+-O2}"
+ENV CFLAGS="-fPIC -pipe ${release:+-O2}" \
+ CC="clang-8"
# Build libgc
ARG gc_version
For distributed binary, the output of the last command will be following. So only relocation
|
Preface
I feel like this is an issue because it's happening on a default installation of Debian 8, 64-bit. If it's not, feel free to close this and I will PM Brian on the forums, thanks!
Issue
After following the Debian installation instructions, and running a blank
.cr file
, (crystal muffin.cr
), this error will occur:I found this post on SO.
ld -v
:The text was updated successfully, but these errors were encountered: