undefined reference to MIN

Asked by Martin Velek

Hello,
trying to link my program I am getting an error message, __big_insert: undefined reference to MIN.
The symbol is undefined in the libc.a

arm-none-eabi-nm libc.a | grep -B 30 MIN
lib_a-hash_bigkey.o:
         U __add_ovflpage
00000000 T __big_delete
00000000 T __big_insert
00000000 T __big_keydata
00000000 T __big_return
00000000 T __big_split
         U __call_hash
00000000 t collect_data
00000000 t collect_key
         U __errno
00000000 T __find_bigpair
00000000 T __find_last_page
         U free
         U __free_ovflpage
         U __get_buf
         U malloc
         U memcmp
         U memmove
         U MIN

and MIN is not defined in the libc.a, arm-none-eabi-nm --defined-only libc.a | grep MIN (no output).

Probably it has a connection with the including #include <sys/param.h> in newlib file hash_bigkey.c. The ARM port does define MIN MAX macros as other targets do.

Question information

Language:
English Edit question
Status:
Answered
For:
GNU Arm Embedded Toolchain Edit question
Assignee:
No assignee Edit question
Last query:
Last reply:
Revision history for this message
Andre Vieira (andre-simoesdiasvieira) said :
#5

Hi Martin,

Sorry for the delay. I would like you to know that we acknowledged your report and are in the process of fixing this.

Kind Regards,

Revision history for this message
Launchpad Janitor (janitor) said :
#6

This question was expired because it remained in the 'Open' state without activity for the last 15 days.

Revision history for this message
Andre Vieira (andre-simoesdiasvieira) said :
#7

Hi Martin,

Just letting you know we are still working on this, I'm hoping to have something for you very soon.

I can confirm that the libraries were indeed compiled without the MIN (and MAX) macro's for that particular source. I am now working on a patch to include these definitions.

Revision history for this message
Andre Vieira (andre-simoesdiasvieira) said :
#8

Still being worked on.

Revision history for this message
Andre Vieira (andre-simoesdiasvieira) said :
#9

Hi Martin,

Thank you for point it out this bug.

Our patch to fix this issue has been applied upstream. The libraries in the upcoming release should no longer have the undefined MIN symbol.

Patch [0/3]: https://sourceware.org/ml/newlib/2015/msg00595.html
Patch [1/3]: https://sourceware.org/ml/newlib/2015/msg00607.html
Patch [2/3]: https://sourceware.org/ml/newlib/2015/msg00597.html
Patch [3/3]: https://sourceware.org/ml/newlib/2015/msg00598.html

BR,

Can you help with this problem?

Provide an answer of your own, or ask Martin Velek for more information if necessary.

To post a message you must log in.