Ubuntu Mate 18.04 LTS - issue with Atmel Toolchains

Go To Last Post
7 posts / 0 new
Author
Message
#1
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Recently upgraded my main machine from Lucid Lynx (10.04 LTS... yes, ancient!) to Bionic Beaver (yes, it's a silly name... let's get over it quickly... ;-)

 

I seem to have an issue now when using any of the Atmel toolchains to build my projects:

2 joeymorin@stinky:~/c.src/AVR/blink_delay_ms$ make
avr-gcc -DF_CPU=16000000UL -I . -include blink_delay_ms.h -Os -mmcu=attiny85 -mrelax -fjump-tables  -maccumulate-args -fno-inline-small-functions -funsigned-char -funsigned-bitfields -fpack-struct -fshort-enums -fno-tree-scev-cprop -fsplit-wide-types -mbranch-cost=3  -pedantic -H   -Wc++-compat -mstrict-X   -std=gnu11 -g -W -Wall -Wextra -Wunused -Wstrict-prototypes -Wundef -Werror -fno-exceptions -fdata-sections -ffunction-sections -save-temps -c -include fuses_and_lockbits.h blink_delay_ms.c
. /home/joeymorin/Software/AVR_toolchain/avr8-gnu-toolchain-linux_x86_64.3.5.4/avr/include/util/delay.h
.. /home/joeymorin/Software/AVR_toolchain/avr8-gnu-toolchain-linux_x86_64.3.5.4/avr/include/util/delay_basic.h
.. /home/joeymorin/Software/AVR_toolchain/avr8-gnu-toolchain-linux_x86_64.3.5.4/avr/include/math.h
Multiple include guards may be useful for:
./blink_delay_ms.h
./fuses_and_lockbits.h
as: loadlocale.c:130: _nl_intern_locale_data: Assertion `cnt < (sizeof (_nl_value_type_LC_TIME) / sizeof (_nl_value_type_LC_TIME[0]))' failed.
avr-gcc: internal compiler error: Aborted (program as)
Please submit a full bug report,
with preprocessed source if appropriate.
See <http://www.atmel.com> for instructions.
Makefile:174: recipe for target 'blink_delay_ms' failed
make: *** [blink_delay_ms] Error 4

 

This seems to be related to:

https://forum.manjaro.org/t/stable-update-2018-05-07-kernels-mesa-glibc-php-nvidia-plasma5-firefox/46632/309

(use CTRL-F to find loadlocale)

Bertie 2018-05-16 13:57:51 UTC #316

I have a problem with the new glibc:
Programs from the avr-toolchain, such as avr-gcc, as, etc. exit with an error:

as: loadlocale.c:130: _nl_intern_locale_data: Assertion `cnt < (sizeof (_nl_value_type_LC_TIME) / sizeof (_nl_value_type_LC_TIME[0]))' failed.

Although my locale is correct, the variable LC_TIME does not seem to be imported correctly by glibc for my specific setting.

The temporary solution is:

$ export LANG=C 

in the current terminal session before running an affected program. (This will then be set for the duration of the terminal session) , or

$ LANG=C program     (for example $ LANG=C avr-gcc)

on a per program instance.

In 2015 I had a similar problem with glibc which affected the variable LC_COLLATE, with the same temporary solution. Seemed that only Arch based distros were affected. This remained for many months until it finally disappeared (fixed).

If you have this similar problem, do not try to downgrade glibc.

 

The solution proposed seems to do the trick, but I'm unclear on any side effects it may have.  In particular, what might be the implications of changing the value of LANG from it's default (en_CA.UTF-8 in my case) to 'C'?

 

"Experience is what enables you to recognise a mistake the second time you make it."

"Good judgement comes from experience.  Experience comes from bad judgement."

"Wisdom is always wont to arrive late, and to be a little approximate on first possession."

"When you hear hoofbeats, think horses, not unicorns."

"Fast.  Cheap.  Good.  Pick two."

"We see a lot of arses on handlebars around here." - [J Ekdahl]

 

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Changing locale can affect a number of things, like error messages; for instance, that's how you'd set things to request non-English error messages.

 

But it shouldn't affect the actual output of the assembler, and seems safe enough. What's the current value? ("echo $LANG" at a prompt.)

 

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

the_real_seebs wrote:
What's the current value? ("echo $LANG" at a prompt.)

joeymorin wrote:
In particular, what might be the implications of changing the value of LANG from it's default (en_CA.UTF-8 in my case) to 'C'?

"Experience is what enables you to recognise a mistake the second time you make it."

"Good judgement comes from experience.  Experience comes from bad judgement."

"Wisdom is always wont to arrive late, and to be a little approximate on first possession."

"When you hear hoofbeats, think horses, not unicorns."

"Fast.  Cheap.  Good.  Pick two."

"We see a lot of arses on handlebars around here." - [J Ekdahl]

 

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

I'm having the same issue - really annoying.

 

EDIT: a bug is opened on Launchpad

https://bugs.launchpad.net/ubunt...

 

Hope it's going to get fixed soon.

Last Edited: Tue. Jul 3, 2018 - 01:28 PM
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 1

Quick workaround is to set the LC_LANG environment variable to something invalid before invoking the toolchains (i.e just some random chars should do).
.
The reason is that glibc has changed its locale representation 'recently', but the linker built by us is statically linked. This causes the locale to fail to load. Setting it to something invalid causes it to fall back.

:: Morten

 

(yes, I work for Atmel, yes, I do this in my spare time, now stop sending PMs)

Last Edited: Mon. Jul 23, 2018 - 04:31 PM
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

An update to Ubuntu Mate 18.04 LTS appears to have fixed the issue.

 

I had been using this to work around th problem:

$ alias | grep LANG
alias avr-gcc='LANG=C avr-gcc'

... but that is no longer necessary.  I don't know when it became so, but this morning I noticed an update come through for:

https://bugs.launchpad.net/ubuntu/+source/ubiquity/+bug/1783326

... but I haven't dug deeper to determine if this is what fixed it.

"Experience is what enables you to recognise a mistake the second time you make it."

"Good judgement comes from experience.  Experience comes from bad judgement."

"Wisdom is always wont to arrive late, and to be a little approximate on first possession."

"When you hear hoofbeats, think horses, not unicorns."

"Fast.  Cheap.  Good.  Pick two."

"We see a lot of arses on handlebars around here." - [J Ekdahl]

 

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

I wrote:
... but that is no longer necessary.
Well, I was wrong.  Apparently I'd added the work-around in two places

  1. ~/.bash_aliases
  2. ~/.profile

 

I'd only removed the work-around from the first, but not the second.  I noticed this today while editing .profile for a different reason.  Sure enough, removing it there reverted to the broken behaviour.

 

So this is still an outstanding issue.

"Experience is what enables you to recognise a mistake the second time you make it."

"Good judgement comes from experience.  Experience comes from bad judgement."

"Wisdom is always wont to arrive late, and to be a little approximate on first possession."

"When you hear hoofbeats, think horses, not unicorns."

"Fast.  Cheap.  Good.  Pick two."

"We see a lot of arses on handlebars around here." - [J Ekdahl]