delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/2020/05/09/12:33:36

X-Authentication-Warning: delorie.com: mail set sender to djgpp-bounces using -f
X-Recipient: djgpp AT delorie DOT com
Subject: Re: Changes to config/i386/djgpp.c
To: "J.W. Jagersma" <jwjagersma AT gmail DOT com>,
"DJGPP List (E-mail)" <djgpp AT delorie DOT com>
References: <65c420b7-835c-cba6-6ff6-22d530d513bf AT iki DOT fi>
<c1091957-2c67-68ae-4614-2c6fbded7580 AT gmail DOT com>
From: "Andris Pavenis (andris DOT pavenis AT iki DOT fi) [via djgpp AT delorie DOT com]" <djgpp AT delorie DOT com>
Message-ID: <b39f4c27-15bf-d773-db70-94d307f87de3@iki.fi>
Date: Sat, 9 May 2020 19:28:33 +0300
User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:68.0) Gecko/20100101
Thunderbird/68.7.0
MIME-Version: 1.0
In-Reply-To: <c1091957-2c67-68ae-4614-2c6fbded7580@gmail.com>
Reply-To: djgpp AT delorie DOT com
Errors-To: nobody AT delorie DOT com
X-Mailing-List: djgpp AT delorie DOT com
X-Unsubscribes-To: listserv AT delorie DOT com

On 5/9/20 4:55 PM, J.W. Jagersma wrote:
> Hi Andris,
> Thanks for making gcc 10 available so quickly.  I updated my build
> scripts and applied my patch, but then ran into a problem:
>
>      i386-pc-msdosdjgpp-gcc -pipe ... -c symify.c
>      i386-pc-msdosdjgpp-ld -s  ../../../lib/crt0.o symify.o ../../../lib/libdbg.a ../../../lib/libc.a -o ../../../bin/symify.exe D:/msys64/usr/local/cross/lib/gcc/i386-pc-msdosdjgpp/10.1.0/libgcc.a -T ../../../lib/djgpp.djl
>      D:\msys64\usr\local\cross\bin\i386-pc-msdosdjgpp-ld.exe: ../../../lib/libc.a(stdiohk.o):stdiohk.c:(.data+0x0): multiple definition of `__stdio_cleanup_hook'; ../../../lib/libc.a(exit.o):exit.c:(.bss+0x8): first defined here
>      make[2]: *** [makefile:22: ../../../bin/symify.exe] Error 1
>      make[1]: *** [makefile.sub:2: all_subs] Error 2
>      make: *** [makefile:10: all] Error 2
>
> At first I thought it was caused by my patch, since it looks like this
> symbol is placed in .bss in one compilation unit, and .data in another.
> However this problem didn't occur with gcc 9.  Inspecting the release
> notes for gcc 10, I found that gcc now links with -fno-common by
> default, so I think this needs to be fixed in libc now by declaring the
> symbol in exit.c with extern linkage:
>
>      extern void (*__stdio_cleanup_hook)(void);
>
> Or alternatively, libc needs to be compiled with -fcommon now.
> Did you run into this issue too?  How did you solve it?

Known problem:

int foo;

int foo = 1;

No more works with gcc-10. One must write instead:

extern int foo;

int foo = 1;

Example how it can be fixed can be seen in ArchLinux AUR package which I updated yesterday:

https://aur.archlinux.org/packages/djgpp-djcrx/

Problem is mentioned in https://gcc.gnu.org/gcc-10/changes.html

The changes done for AUR package should perhaps be not committed to DJGPP CVS (no need to support 
old compilers for ArchLinux)

Andris


PS. Sending also to djgpp mailing list as somebody else could be interested in that



- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019