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

Build fixes #11

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open

Conversation

tpetazzoni
Copy link
Contributor

No description provided.

gcc 10, if it recognizes some hand-written code that looks like
memcpy, will generate a call to memcpy().

For example:

        while (dst < &_end_data) {
                *dst++ = *src++;
        }

gets recognized as such. However, in the context of bare-metal code,
having a call to memcpy() in the C library doesn't work. So we fix
that by disabling builtins.

Fixes:

/home/thomas/projets/buildroot/output/host/opt/ext-toolchain/bin/../arm-buildroot-uclinux-uclibcgnueabi/bin/ld.real: stm32f429i-disco.o: in function `reset':
stm32f429i-disco.c:(.text.reset+0x1a): undefined reference to `memcpy'
/home/thomas/projets/buildroot/output/host/opt/ext-toolchain/bin/../arm-buildroot-uclinux-uclibcgnueabi/bin/ld.real: stm32f429i-disco.c:(.text.reset+0x34): undefined reference to `memset'
make[1]: *** [Makefile:26: stm32f429i-disco] Error 1

Upstream: mcoquelin-stm32#9
Signed-off-by: Thomas Petazzoni <[email protected]>
In commit 0f3e61c ("Use ld instead of
gcc for linking "), we started using ld instead of gcc for the link
step. This worked fine for a while, but recent versions of ld no
longer accept the -nostartfiles option, causing the build to break:

Error: unable to disambiguate: -nostartfiles (did you mean --nostartfiles ?)

In fact, -nostartfiles was passed to gcc prior to
0f3e61c, but it is not a ld
option. It is only by luck that it was accepted and ignored by older
ld versions. Since this option is useless when calling ld directly, we
can simply drop it.

Signed-off-by: Thomas Petazzoni <[email protected]>
@yann-morin-1998
Copy link

Build-tested with:

  • binutils 2.32: builds OK before and after this patch (no regression)
  • binutils 2.36.1: failed before this patch, builds OK after (fixed)

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 this pull request may close these issues.

2 participants