Posts: 2020
Threads: 133
Joined: July 26, 2017
Reputation:
5
Installing GCC 13.1.0
May 1, 2023 at 8:39 am
(This post was last modified: May 1, 2023 at 8:40 am by FlatAssembler.)
Did anybody here manage to install GCC 13.1.0 on their computer? When I try to build it from source on my 64-bit Debian Linux, I get the following error message:
Code: /usr/bin/ld: .libs/hwasan.o: relocation R_X86_64_PC32 against undefined symbol `__ehdr_start' can not 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
make[4]: *** [Makefile:559: libhwasan.la] Error 1
make[4]: Leaving directory '/home/teo/gcc-objdir/x86_64-pc-linux-gnu/libsanitizer/hwasan'
make[3]: *** [Makefile:532: all-recursive] Error 1
make[3]: Leaving directory '/home/teo/gcc-objdir/x86_64-pc-linux-gnu/libsanitizer'
make[2]: *** [Makefile:419: all] Error 2
make[2]: Leaving directory '/home/teo/gcc-objdir/x86_64-pc-linux-gnu/libsanitizer'
make[1]: *** [Makefile:22725: all-target-libsanitizer] Error 2
make[1]: Leaving directory '/home/teo/gcc-objdir'
make: *** [Makefile:1090: all] Error 2
I configured it with:
Code: ../gcc-13.1.0/configure --enable-languages=c,c++ --disable-multilib
I currently have GCC 12.2.0.
Since this is a linker error, I suppose it may be relevant that my GNU Linked version is 2.31.1.
So, what does this error message I am getting mean? And how can I fix that?
The probability that I will manage to install GCC 13.1.0 on Windows is so low it's not even worth trying. Do you agree?
Posts: 29601
Threads: 116
Joined: February 22, 2011
Reputation:
159
RE: Installing GCC 13.1.0
May 1, 2023 at 9:03 am
You might want to consider changing your major.
Posts: 1659
Threads: 5
Joined: September 26, 2018
Reputation:
12
RE: Installing GCC 13.1.0
May 1, 2023 at 9:53 am
It tells you the problem:
"recompile with -fPIC"
Google what that means. I've always used it in my UNIX or LINUX compiles. It doesn't make sense not to use it.
Posts: 2020
Threads: 133
Joined: July 26, 2017
Reputation:
5
RE: Installing GCC 13.1.0
May 1, 2023 at 10:16 am
For now, I can access GCC 13.1.0 using GitLab CI/CD. So, I was able to tweak my AEC-to-WebAssembly compiler to compile under GCC 13.1.0 using error messages given to me by GitLab: https://gitlab.com/FlatAssembler/AECforW...4202281750
But that's not good enough for me. For one thing, GitLab is very slow, it takes it around 10 minutes to give me the error messages (or the message that it succeeded). Secondly, I can only do that for projects which I host on GitLab, and, not only that, for which I've also set up GitLab CI/CD. So, for most of my C++ projects, even those on my GitLab profile, I still don't know whether they compile using GCC 13.1.0. Furthermore, as I have a free GitLab account, I have limited minute-actions. I think I am nowhere close to that limit, but I don't know.
Those are the reasons I'd like to have the latest version of GCC, GCC 13.1.0, on my machine.
Posts: 2020
Threads: 133
Joined: July 26, 2017
Reputation:
5
RE: Installing GCC 13.1.0
May 1, 2023 at 10:19 am
(This post was last modified: May 1, 2023 at 10:44 am by FlatAssembler.)
(May 1, 2023 at 9:03 am)Angrboda Wrote: You might want to consider changing your major.
And which major should I switch to? And isn't there too much sunk cost, now that I have only two courses left to the diploma (Communication Skills and Basics of Automatic Control)?
Posts: 2020
Threads: 133
Joined: July 26, 2017
Reputation:
5
RE: Installing GCC 13.1.0
May 1, 2023 at 10:20 am
(This post was last modified: May 1, 2023 at 10:43 am by FlatAssembler.)
(May 1, 2023 at 9:53 am)HappySkeptic Wrote: It tells you the problem:
"recompile with -fPIC"
Google what that means. I've always used it in my UNIX or LINUX compiles. It doesn't make sense not to use it.
I am not invoking GCC manually, it's the GNU Make that's invoking it. Unless I modify the Makefile, I have no control over how GNU Make invokes GCC.
Posts: 1659
Threads: 5
Joined: September 26, 2018
Reputation:
12
RE: Installing GCC 13.1.0
May 1, 2023 at 10:27 am
Is there not a pre-build package for Debian? Have you googled for this error and seen if anyone has a workaround?
Google is your friend. If you can't get a hit, you are probably doing something wrong. As for this one, the compiler you are using to do the build, and the configure script or Makefile must not work together. One solution might be to hack the configure or Makefile and add the -fPIC parameter.
Or, you can give up and try something different. Learn from Google.
Posts: 30974
Threads: 204
Joined: July 19, 2011
Reputation:
141
RE: Installing GCC 13.1.0
May 1, 2023 at 10:38 am
When I hire junior engineers, I don't care so much that they know an answer to a particular problem, but I do care that they can identify appropriate resources to leverage in order to find the correct answer.
This forum isn't it.
Try stackexchange, if you aren't utterly incompetent you should be able to find an answer in about five seconds.
Posts: 2020
Threads: 133
Joined: July 26, 2017
Reputation:
5
RE: Installing GCC 13.1.0
May 1, 2023 at 2:41 pm
HappySkeptic Wrote:Is there not a pre-build package for Debian? How could there be? GCC 13.1 was released only days ago. You can expect to appear on Docker (and thus GitLab) so early, not in the Debian repository.
Besides, Debian is not Fedora. Fedora provides RPMs for the version of GCC with the latest features, which would, today, be GCC 13.1.
Debian's policy is, as far as I know, to provide a DEB package for the version of GCC which is likely to have the least amount of bugs, which is, today, either GCC 10.4 or GCC 9.5.
And Oracle Linux'es policy is... I don't know what exactly, why it ships with GCC 4.8.5, but it's clearly some hyper-bug-fix release, rather than whichever happened to be the most feature-full release at the time.
HappySkeptic Wrote:Have you googled for this error and seen if anyone has a workaround? No. I don't even know what I should type into Google.
HappySkeptic Wrote:As for this one, the compiler you are using to do the build, and the configure script or Makefile must not work together. Or perhaps there is a bug in the version GNU linker provided with Debian. After all, it's a linker error.
Jackalope Wrote:Try stackexchange, if you aren't utterly incompetent you should be able to find an answer in about five seconds. Then I guess I am utterly incompetent by that measure. Even though I have asked dozens of well-received questions on StackExchange.
Posts: 30974
Threads: 204
Joined: July 19, 2011
Reputation:
141
RE: Installing GCC 13.1.0
May 1, 2023 at 2:56 pm
Missed the point, as usual.
|