[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[avrdude-dev] Weird errors depending on CFLAGS/CPPFLAGS/LDFLAGS
From: |
Sven Schwermer |
Subject: |
[avrdude-dev] Weird errors depending on CFLAGS/CPPFLAGS/LDFLAGS |
Date: |
Wed, 30 Jan 2019 19:28:28 +0100 |
User-agent: |
Mozilla/5.0 (X11; Linux x86_64; rv:60.0) Gecko/20100101 Thunderbird/60.4.0 |
Hi,
I have an Attiny817 Xplained Mini board which I want to use with
AVRDUDE. I am using the trunk as I realize, I need commit 1417 for the
Xplained Mini to work at all. I am using Arch Linux which is why I tried
the avrdude-svn AUR (https://aur.archlinux.org/packages/avrdude-svn) but
I got the following error message after building and running that:
avrdude: jtag3_edbg_recv(): Inconsistent fragment number; expect 1, got 0
When building straight from source, everything works great. I went ahead
and verified that the makepkg tool which Arch uses to build these
packages was in fact checking out the latest trunk. Next, I investigated
the environment that the package was being built in. I saw the following
interesting settings:
LDFLAGS=-Wl,-O1,--sort-common,--as-needed,-z,relro,-z,now
CPPFLAGS=-D_FORTIFY_SOURCE=2
CFLAGS=-march=x86-64 -mtune=generic -O2 -pipe -fno-plt
When unsetting all those variables right before the configure call, the
built binary works as expected with makepkg. When not unsetting any of
the above variables, the binary emits the aforementioned error. I also
verified that the problem arises when I build from source without
makepkg like so:
make distclean
./bootstrap
CPPFLAGS='-D_FORTIFY_SOURCE=2' CFLAGS='-march=x86-64 -mtune=generic -O2
-pipe -fno-plt'
LDFLAGS='-Wl,-O1,--sort-common,--as-needed,-z,relro,-z,now' ./configure
--sysconfdir=/etc
make
./avrdude -p t817 -c xplainedmini_updi
Does anyone know how those variables can alter the build process so that
the software doesn't work properly? I'll try to play with the values of
the variables a little bit and I'll try attach a debugger. I'm using GCC
8.2.1 and GNU libc 2.28.
Best regards,
Sven
- [avrdude-dev] Weird errors depending on CFLAGS/CPPFLAGS/LDFLAGS,
Sven Schwermer <=