delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/2020/12/10/11:42:03

X-Authentication-Warning: delorie.com: mail set sender to djgpp-bounces using -f
X-Recipient: djgpp AT delorie DOT com
X-Original-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
d=gmail.com; s=20161025;
h=subject:to:references:from:message-id:date:user-agent:mime-version
:in-reply-to:content-language:content-transfer-encoding;
bh=CDRMRZ99Zn9bnjKzfPlCCdo/IUqfww/R3NzLZKXqd/Y=;
b=b7qSd7LqeLykuCzt9xwMS//GAsYL19LZeAGjBvYSBASiNXzUIe9f+ih7vrTOq+oXoB
zU/1ktBvlFA6K5zE9gLErKRtK67rKK3n/xwTM2nTD9uCrTCt219MSPw3EdE2wK+VSMue
c35naCFpKydoEZurV5c5XyQC3ZS5DzJtqSvsN+z2rNlrrbFy++T5Q4z5oSps0r3uzIh8
+HJILbxARlCAV9SFfYqGdKIwZZT5HklbMGdpvlsYnqzs5cO3dCjKsdR9uCI0ozedD4QI
sMyt5LoO+JTMfrWIwXZeAlBqnNO0wqmTi++DdskdNBERkqtpN5uaHcTVV+VjUbumjed5
zQsA==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
d=1e100.net; s=20161025;
h=x-gm-message-state:subject:to:references:from:message-id:date
:user-agent:mime-version:in-reply-to:content-language
:content-transfer-encoding;
bh=CDRMRZ99Zn9bnjKzfPlCCdo/IUqfww/R3NzLZKXqd/Y=;
b=YkRHktn7uv43McVS1111lMgNQn9YAuSs17IyRrqoGC94gC/LVpjFPyDkD5eDAGtuQR
v7nSVvcw9U6a753c2ZNT/Ouyp+B18CsVi9rqrbZJ7qQL9kKVaFIysYeoS5yNwtBmC9nB
1xnm4YV16RM3Fugady+N5XftLpS8S/0pEEkAJ9F2KyaqfQkS91ctLpySMeO8DHIzIkku
SmIJQnEsAALLsp/s+42COg6YU6ipP+uhQ3FOey6Uro+AG/6+NaqzkQ20bVzuxFs0K1pA
flSySSKzKSPA6CHM4SXLExNXkdRRExF0yOUicC8M1o0cxa9YETvUEesFCZvS5DxdcvPK
sYzg==
X-Gm-Message-State: AOAM533YJ4D0r5ZlyPwE8aVEMRg+xjkxA7qpfpkJRQfJ/YloywHcEzIM
MOyy0LTpooXxfX/mwqMePGsziCYfHHo=
X-Google-Smtp-Source: ABdhPJyhMUPWEMek4SM8QxW94zORiYdPyycKeWZ47q3UqfL9PuEvuBz8oizaFTqz8PSYc8pI/1p7ew==
X-Received: by 2002:a1c:b608:: with SMTP id g8mr9173145wmf.110.1607618305172;
Thu, 10 Dec 2020 08:38:25 -0800 (PST)
Subject: Re: Difficulties compiling libc from repository using gcc 10.N.0
To: djgpp AT delorie DOT com
References: <5FD1FEA1 DOT 7010304 AT gmx DOT de>
From: "J.W. Jagersma (jwjagersma AT gmail DOT com) [via djgpp AT delorie DOT com]" <djgpp AT delorie DOT com>
Message-ID: <8816d501-9f33-4d68-4235-1935a83580f6@gmail.com>
Date: Thu, 10 Dec 2020 17:38:22 +0100
User-Agent: Mozilla/5.0 (Windows NT 6.1; Win64; x64; rv:78.0) Gecko/20100101
Thunderbird/78.5.1
MIME-Version: 1.0
In-Reply-To: <5FD1FEA1.7010304@gmx.de>
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 2020-12-10 11:55, Juan Manuel Guerrero (juan DOT guerrero AT gmx DOT de) [via djgpp AT delorie DOT com] wrote:
> I have tried to compile the the repository code of libc and the compiler stoped with the follwing error message:
> 
> C:/DJGPP-2.05/BIN/make.exe -C common
> gcc ... -c dbgcom.c
> dbgcom.c: Assembler messages:
> dbgcom.c:1342: Error: symbol `.Ldoes_not_has_read_right' is already defined
> dbgcom.c:1346: Error: symbol `.Ldoes_not_has_write_right' is already defined
> make[3]: *** [../../makefile.inc:90: dbgcom.o] Error 1
> make[2]: *** [makefile.sub:2: all_subs] Error 2
> make[1]: *** [../makefile.lib:7: all] Error 2
> make: *** [makefile:45: subs] Error 2
> 
> I have tried this using gcc1010 and gcc1020.  Both fails.  If I use gcc920
> everything works fine.  In all cases bnu234b has been used and no other one
> has been tried.
> 
> 
> Of course there are a lot of other warnings that aborts the compilation like:
> d:/djgpp/include/time.h: In function 'asctime':
> ctime.c:1553:55: warning: '%d' directive writing between 1 and 11 bytes into a region of size between 0 and 12 [-Wformat-overflow=]
>  1553 |   (void) sprintf(result, "%.3s %.3s%3d %02d:%02d:%02d %d\n",
>       |                                                       ^~
> ctime.c:1553:26: note: directive argument in the range [-2147481748, 2147483647]
>  1553 |   (void) sprintf(result, "%.3s %.3s%3d %02d:%02d:%02d %d\n",
>       |                          ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
> ctime.c:1553:10: note: 'sprintf' output between 17 and 68 bytes into a destination of size 26
>  1553 |   (void) sprintf(result, "%.3s %.3s%3d %02d:%02d:%02d %d\n",
>       |          ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
>  1554 |                  wday_name[timeptr->tm_wday],
>       |                  ~~~~~~~~~~~~~~~~~~~~~~~~~~~~
>  1555 |                  mon_name[timeptr->tm_mon],
>       |                  ~~~~~~~~~~~~~~~~~~~~~~~~~~
>  1556 |                  timeptr->tm_mday, timeptr->tm_hour,
>       |                  ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
>  1557 |                  timeptr->tm_min, timeptr->tm_sec,
>       |                  ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
>  1558 |                  TM_YEAR_BASE + timeptr->tm_year);
>       |                  ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
> d:/djgpp/include/time.h: In function 'ctime':
> ctime.c:1553:55: warning: '%d' directive writing between 1 and 11 bytes into a region of size between 0 and 12 [-Wformat-overflow=]
>  1553 |   (void) sprintf(result, "%.3s %.3s%3d %02d:%02d:%02d %d\n",
>       |                                                       ^~
> ctime.c:1553:26: note: directive argument in the range [-2147481748, 2147483647]
>  1553 |   (void) sprintf(result, "%.3s %.3s%3d %02d:%02d:%02d %d\n",
>       |                          ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
> ctime.c:1553:10: note: 'sprintf' output between 17 and 68 bytes into a destination of size 26
>  1553 |   (void) sprintf(result, "%.3s %.3s%3d %02d:%02d:%02d %d\n",
>       |          ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
>  1554 |                  wday_name[timeptr->tm_wday],
>       |                  ~~~~~~~~~~~~~~~~~~~~~~~~~~~~
>  1555 |                  mon_name[timeptr->tm_mon],
>       |                  ~~~~~~~~~~~~~~~~~~~~~~~~~~
>  1556 |                  timeptr->tm_mday, timeptr->tm_hour,
>       |                  ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
>  1557 |                  timeptr->tm_min, timeptr->tm_sec,
>       |                  ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
>  1558 |                  TM_YEAR_BASE + timeptr->tm_year);
>       |                  ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
> 
> 
> or:
> d:/djgpp/include/io.h: In function '_chmod':
> _chmod.c:28:14: warning: array subscript 1 is outside array bounds of 'int[1]' [-Warray-bounds]
>    28 |     r.x.cx = *(&func + 1);  /* Value to set */
>       |              ^~~~~~~~~~~~
> _chmod.c:14:34: note: while referencing 'func'
>    14 | _chmod(const char *filename, int func, ...)
>       |                              ~~~~^~~~
> 
> The -Warray-bounds appears quite a lot due to our way to address neighborhood variables as can
> be seen in the example above.  May be some with some spare time can fix these occurencies.
> 
> Regards,
> Juan M. Guerrero

Also note that linking will fail with gcc 10 since it now uses -fno-common by
default, I worked around that with the following patch:

---
 src/debug/fsdb/makefile     | 2 ++
 src/libc/ansi/stdlib/exit.c | 2 +-
 2 files changed, 3 insertions(+), 1 deletion(-)

diff --git a/src/debug/fsdb/makefile b/src/debug/fsdb/makefile
index da796d41..41f145fb 100644
--- a/src/debug/fsdb/makefile
+++ b/src/debug/fsdb/makefile
@@ -12,6 +12,8 @@ EOBJS += unassmbl.o
 
 include $(TOP)/../makefile.inc
 
+CFLAGS += -fcommon
+
 #relax error checking:
 XGCC = $(XLGCC)
 
diff --git a/src/libc/ansi/stdlib/exit.c b/src/libc/ansi/stdlib/exit.c
index 94634b11..79b40ae9 100644
--- a/src/libc/ansi/stdlib/exit.c
+++ b/src/libc/ansi/stdlib/exit.c
@@ -15,7 +15,7 @@
 
 struct __atexit *__atexit_ptr = 0;
 
-void (*__stdio_cleanup_hook)(void);
+extern void (*__stdio_cleanup_hook)(void);
 
 /* A hook to close down the file system extensions if any where opened.
    This does not force them to be linked in. */

- Raw text -


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