jeanthom / boot2duino

The World's Most Useless Arduino Platform.
BSD Zero Clause License
73 stars 10 forks source link

Arduino IDE 1.8.19, "collect2 error: ld returned 1 exit status" #6

Closed AndroidLeo01 closed 2 years ago

AndroidLeo01 commented 2 years ago

Hi, guys, I wanted to try it but I'm not able to compile anything and I don't understand the problem. Here is the log message from the arduino IDE on my linux mint VM. I had to install g++, and i'm using version 9.3.0. Am i missing something? Need other information? To me, it seems a memory problem, but i set the VM with 8Gb RAM, and still have 12Gb of free space on HDD.

_/usr/bin/ld: warning: changing start of section .plt by 9 bytes /usr/bin/ld: warning: changing start of section .plt.got by 1 byte /usr/bin/ld: warning: changing start of section .gnu.version_d by 2 bytes /usr/bin/ld: warning: changing start of section .gnu.version_r by 2 bytes /usr/bin/ld: warning: changing start of section .dynsym by 2 bytes /usr/bin/ld: warning: changing start of section .gnu.hash by 3 bytes /usr/bin/ld: warning: changing start of section .plt by 9 bytes /usr/bin/ld: warning: changing start of section .plt.got by 1 byte /usr/bin/ld: warning: changing start of section .gnu.version_d by 2 bytes /usr/bin/ld: warning: changing start of section .gnu.versionr by 2 bytes /usr/bin/ld: warning: changing start of section .dynsym by 2 bytes /usr/bin/ld: warning: changing start of section .gnu.hash by 3 bytes /usr/bin/ld: section .dynamic LMA [0000000000007e00,0000000000007e8f] overlaps section .text LMA [0000000000007e00,0000000000007e26] /usr/bin/ld: section .interp LMA [0000000000007e27,0000000000007e39] overlaps section .dynamic LMA [0000000000007e00,0000000000007e8f] collect2: error: ld returned 1 exit status exit status 1 Error compiling for board Generic x86 computer.

Btw I love this project, what about LPT implementation? could transform an old PC into a freaking super IPC micro-controller lol

Thanks in advance

jeanthom commented 2 years ago

Hi,

To me, it seems a memory problem, but i set the VM with 8Gb RAM, and still have 12Gb of free space on HDD. It's not a RAM/storage problem, it's a linker problem. The linker is a program that takes compiled/assembled code and outputs a nicely formatted binary file. boot2duino uses a linker script to specify the binary format (you can check it out here: https://github.com/jeanthom/boot2duino/blob/main/variants/x86-pc/linker.ld).

It looks like some compiled code overlaps from one defined section to another, which means that the linker can't follow the instructions I gave it.

  1. Could you upload the full compilation log? And also the zipped Arduino build folder (you'll find it in /tmp)
  2. Could you try to upgrade to GCC 11? boot2duino is a hacky project and I only got the occasion to try it out on my laptop (which is running GCC 11).

what about LPT implementation? It's technically feasible to interface boot2duino to an LPT port (https://wiki.osdev.org/LPT is a very good resource on that matter), but I'm pretty sure I threw in the trash every single old PC/laptop that had a parallel port, so I can't test it properly :/

AndroidLeo01 commented 2 years ago

arduino_build_550520.tar.gz

Here is the tar file. Now i'm trying to install gcc-11

AndroidLeo01 commented 2 years ago

YES Thank you! It was GCC version problem. I installed ubuntu 21 and gcc 11 and now it works perfectly! immagine

jeanthom commented 2 years ago

Thanks for trying this! I'll write this in the README

CyDefghi commented 2 years ago

For the same issue, I just placed "*(.dynamic)" in the "/DISCARD/" section in the file "linker.ld". May be brutal, but it works with gcc 10.2.1 on Debian Bullseye.