This is the mail archive of the
glibc-bugs@sourceware.org
mailing list for the glibc project.
[Bug locale/23164] New: LC_MONETARY data incorrect with static linking
- From: "jwakely.gcc at gmail dot com" <sourceware-bugzilla at sourceware dot org>
- To: glibc-bugs at sourceware dot org
- Date: Thu, 10 May 2018 22:56:35 +0000
- Subject: [Bug locale/23164] New: LC_MONETARY data incorrect with static linking
- Auto-submitted: auto-generated
https://sourceware.org/bugzilla/show_bug.cgi?id=23164
Bug ID: 23164
Summary: LC_MONETARY data incorrect with static linking
Product: glibc
Version: 2.27
Status: UNCONFIRMED
Severity: normal
Priority: P2
Component: locale
Assignee: unassigned at sourceware dot org
Reporter: jwakely.gcc at gmail dot com
Target Milestone: ---
This program works when linked to libc.so but not when linked to libc.a
#define _GNU_SOURCE
#include <locale.h>
#include <langinfo.h>
#include <stdio.h>
int main()
{
locale_t loc = newlocale(1 << LC_ALL, "en_US.UTF-8", 0);
const char* ccurr = nl_langinfo_l(CURRENCY_SYMBOL, loc);
printf("Currency symbol: %s\n", ccurr);
return 0;
}
$ gcc loc.c
$ ./a.out
Currency symbol: $
$ gcc loc.c -static
$ ./a.out
Currency symbol:
The returned value is an empty string instead of "$"
This was reduced from https://gcc.gnu.org/bugzilla/show_bug.cgi?id=85732 which
shows that all LC_MONETARY values are missing for all lcoales when the program
is statically linked.
I see this on several versions, 2.13, 2.25, 2.26, 2.27
--
You are receiving this mail because:
You are on the CC list for the bug.