Fixes compile failure if REENTRANT_SYSCALLS_PROVIDED and MISSING_SYSCALL_NAMES defined
Message ID | PAVPR10MB686294D1DE898DAF7D10EDAA991A2@PAVPR10MB6862.EURPRD10.PROD.OUTLOOK.COM |
---|---|
State | New |
Headers |
Return-Path: <newlib-bounces~patchwork=sourceware.org@sourceware.org> X-Original-To: patchwork@sourceware.org Delivered-To: patchwork@sourceware.org Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id F1871384DEE5 for <patchwork@sourceware.org>; Thu, 16 Jan 2025 15:01:42 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org F1871384DEE5 Authentication-Results: sourceware.org; dkim=fail reason="signature verification failed" (2048-bit key, unprotected) header.d=outlook.com header.i=@outlook.com header.a=rsa-sha256 header.s=selector1 header.b=UUmzpWoZ X-Original-To: newlib@sourceware.org Delivered-To: newlib@sourceware.org Received: from AS8PR04CU009.outbound.protection.outlook.com (mail-westeuropeazolkn190110001.outbound.protection.outlook.com [IPv6:2a01:111:f403:d201::1]) by sourceware.org (Postfix) with ESMTPS id F25FC384F4B9 for <newlib@sourceware.org>; Thu, 16 Jan 2025 15:00:37 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org F25FC384F4B9 Authentication-Results: sourceware.org; dmarc=pass (p=none dis=none) header.from=outlook.com Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=outlook.com ARC-Filter: OpenARC Filter v1.0.0 sourceware.org F25FC384F4B9 Authentication-Results: server2.sourceware.org; arc=pass smtp.remote-ip=2a01:111:f403:d201::1 ARC-Seal: i=2; a=rsa-sha256; d=sourceware.org; s=key; t=1737039638; cv=pass; b=pDTRsLPG5yspoxacByZ9RlDI7ATN9m6ZrGMirD+T0TYKJDp6w5Us4bc99hMS92Sc2761e762OA0Dx63KRE7+eKrgX+ItD1DHersq4m3y8UbJzf0ykuxm+9fNd0S7mnD3qNL4USN1YFM347QnEEXWc1hYy+52NyEKhIUR8DXG+sY= ARC-Message-Signature: i=2; a=rsa-sha256; d=sourceware.org; s=key; t=1737039638; c=relaxed/simple; bh=tzuHmjZjdR0cBdnRQ/Y3/ZQuu0jvEsLBUp16iO+TrLs=; h=DKIM-Signature:From:To:Subject:Date:Message-ID:MIME-Version; b=YqXARfYQrXgDcXLbagCj+1b2Se0wk8HaHAbp/66uUub7rwGA1kdOCe8Gt5My0PQvnw9ZdZ/1Nrb/IVkoP6GUOJy0y0Qo5fJMhDk0jJlkQfUaGCkEUmqr8/uZemGb3tsyYKKCXJakKLuauUeLAF8h8LaViPfW+35JgATOUdD+6ys= ARC-Authentication-Results: i=2; server2.sourceware.org DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org F25FC384F4B9 ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=BqlgiHWWxnHzpeLxL2KTH+kAsjqiZyo+55pB+HHvBF9OPX1uwZwWQaY35InEKIJsvgWiY5jGZ4cckRL2ELb7O7v5Oq6FUUpFabkMjMvudEohAdmAlXkFkw4D4t8Tgm5TGRuElWG1+/6pI13LtkbP05WX8znkefTUW6qtt6kO3jEEkoD8uCCCnxr34ScjmIdLO7w3LatzOqqEeV52gSciQj4OT+bGC6F2J5hROgJ4y1O5xORXt2TKZR14y+4EgTwWngHdSZdlu1zsV3P8AKOxLZtTyvj9F0QTW9MgEqt5oUqx6xktQLpaYod02hiwNuvLLBGphbH0eF3Zy+1CraBYXA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector10001; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=8pPfTOyoduh6+2S31NnjvTluzceeq26RUbKNVtttRNo=; b=jph1hSwcpHv5Ysy0PHR6YHaUFVJyB5U7hU0c+x/ICQzP7jaA1/vF4bMCPQCu3CeRhcK+gqyydY6jSv4GB1W6Skrjgqlobf222AtlRuKIq+FdFkOLBNmxQZ8l5TwRuFDVe2pj6wSpuIm58547qvoJMQqs29KeHwjaCuE0r/uk9zuW/7Nz6xIcmvcubh9WaeP2nLEVraGFjHtemXcgjW5OrAouBouqZ68p38WwK9A86GoHOoCg2ovKVcTQ2CmtpFyNoamIqoj8Vy3s30lJiUmk5vJ17f1tC1E71jAzvil3rfDcHl/TKetzrgjTpmm5d+t2Z95rk7jO+glIdofRTaXRJQ== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=none; dmarc=none; dkim=none; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=outlook.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=8pPfTOyoduh6+2S31NnjvTluzceeq26RUbKNVtttRNo=; b=UUmzpWoZximnFdTdvmLinrGvCd2/JGd3uChkkBQrgeJac/zJRCjjcS2Gq1Km1iBUP2smGITGccd+SAWKfJLBNpaMuNem5z38O0C7zkacMyl7vHuKpME+JYEZPG4SWzSaWsLcX+HdyEOi3CpL/2SbJtnCLdFegHwn4bLa9j/He+oNstHm9UHPPGvFjUJLkSWebs7ZonVSdLKRoz9+CBkqZr+Jggzf8v5mwblzCg3+tm+s4TQXB+TBufe9wkpi29A7sg2BipGnMLHesYWqwqVZHVWwfRvx4bso1ryxOVpTgRRjmhXys4J9wam7jk7eBx2P7CJzN2hHWJC0I+Kk9tKlGA== Received: from PAVPR10MB6862.EURPRD10.PROD.OUTLOOK.COM (2603:10a6:102:329::11) by AS2PR10MB6448.EURPRD10.PROD.OUTLOOK.COM (2603:10a6:20b:55b::17) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.8377.6; Thu, 16 Jan 2025 15:00:35 +0000 Received: from PAVPR10MB6862.EURPRD10.PROD.OUTLOOK.COM ([fe80::2c97:4ff8:119d:3116]) by PAVPR10MB6862.EURPRD10.PROD.OUTLOOK.COM ([fe80::2c97:4ff8:119d:3116%4]) with mapi id 15.20.8356.010; Thu, 16 Jan 2025 15:00:35 +0000 From: Markus Eisenmann <markus.eisenmann@outlook.com> To: "newlib@sourceware.org" <newlib@sourceware.org> Subject: [PATCH] Fixes compile failure if REENTRANT_SYSCALLS_PROVIDED and MISSING_SYSCALL_NAMES defined Thread-Topic: [PATCH] Fixes compile failure if REENTRANT_SYSCALLS_PROVIDED and MISSING_SYSCALL_NAMES defined Thread-Index: AQHbaCWbFBBs2UbflUCBIiVwBaYMpw== Date: Thu, 16 Jan 2025 15:00:35 +0000 Message-ID: <PAVPR10MB686294D1DE898DAF7D10EDAA991A2@PAVPR10MB6862.EURPRD10.PROD.OUTLOOK.COM> Accept-Language: de-AT, en-GB, en-US Content-Language: de-AT X-MS-Has-Attach: yes X-MS-TNEF-Correlator: msip_labels: x-ms-exchange-messagesentrepresentingtype: 1 x-ms-publictraffictype: Email x-ms-traffictypediagnostic: PAVPR10MB6862:EE_|AS2PR10MB6448:EE_ x-ms-office365-filtering-correlation-id: f9f77559-1e15-488b-7b50-08dd363e8809 x-microsoft-antispam: BCL:0; ARA:14566002|15080799006|7092599003|8060799006|6092099012|8062599003|15030799003|19110799003|461199028|102099032|3412199025|13095399003|440099028|18061999003; x-microsoft-antispam-message-info: =?iso-8859-1?q?Ax1q79wMh4H0kYQAv3yndzQpkl?= =?iso-8859-1?q?GmkH4wZWeCzVQaXE+Lg4duMZfj0hgs5joC6G3qucABbYcfpVW6wk0dffjMl7?= =?iso-8859-1?q?OamBqZv0M88Iv+RS8f7li0AIRsueKnFQYb1GMOZ4/BNa9UPUnxRLXoKGhWKS?= =?iso-8859-1?q?MENxwQKDrhvWlCp+UrPDXyniOkuT3RuqUO+iQD53NFQ3LTTQ1QZ28F5opwuP?= =?iso-8859-1?q?NyLiyCbphwIfgJyFo7joYnjpuvI1yCy/8Q1cHnhoqR1cL7hldP8A5f1aYW74?= =?iso-8859-1?q?+DERFgceXiCSOlEgE4W2kihPWOc4SPBV8IUDhkry3Ztr7XGRdwwgkoVwHFVj?= =?iso-8859-1?q?fQI4zyo0KhHfVaFzSTpAwfjfu+gtxn4dZZP/A9SCksxU5NYPDkidToowmd/3?= =?iso-8859-1?q?OIyviGaikUubb8bqGuCa5twGrrJFweAZccIYztj76cFEQTOpG2K2RthmlSQd?= =?iso-8859-1?q?xaP3kwXPEiUwNP4NpNig8YuqQ6wxDwObBejX+25fSwaSN2LPKWZKcXGqBRwL?= =?iso-8859-1?q?2nRZpindM3AMj/woG9PTae4IZBIbeJ9gIcfC6ayz26lbfJL5NWbiCGNTfZse?= =?iso-8859-1?q?qz80ZOpCdMw/DEa3et41XCLx+t1yZX1PXg7ihVFma3MndFnB2HrEkFjXNLYQ?= =?iso-8859-1?q?l7KjP11dMKum69CVdkinv6BH6tRzU/y3R1GMxbpyXjTbOIFcgI3wEK1eB4Kg?= =?iso-8859-1?q?Oxwfrf+kzl1urcECoNbCVlpnlC++nEzZ1GUr+FeuWqC3C7UedouE/qI6Z9hd?= =?iso-8859-1?q?E209j1sw7AsMsA3FRRY+EhtS7alF775rqHj9e8xN+xc67azlGrGSUSw5XG7P?= =?iso-8859-1?q?tS7RVuVmKwqK2Xg9jP/uMDM5f/EedZOuXqNOc1pc2gdJTSb2JSv4itF8dXAV?= =?iso-8859-1?q?caBEG7pTKLKZFdAbA+xU3lfOBt7CEbt5BnKETSdKvBy2Qk70A8CdsIT7gZkO?= =?iso-8859-1?q?90/OrmpasAa4csCeElyUVInA5DMB+bEHCb0LhGhC2HXuanyIb1+pTRMQqgAK?= =?iso-8859-1?q?TdX2FIxm8Hoe4uwcn1qzAsNZHnzmF8H7WMT24pfE8quxY7nvJ75Gokx3RHrF?= =?iso-8859-1?q?Yl3WzC/q5eyLIl7QQRi/qIC1FI2aaraKhMkZfmEDv8Mmuc8Y8bxVsBjXfhoH?= =?iso-8859-1?q?1FsBL35AZTFYKoJJmsam7amGE7Tb89ncWQng787d2pGOnzfDns/k/tmEG254?= =?iso-8859-1?q?IjH5lPPQNDGIDAU2sgkyr2uzVKLajbVrn7NNuxBgqmU2hbBVijeauoFvtvYt?= =?iso-8859-1?q?3X+BrRSGx0bA=3D=3D?= x-ms-exchange-antispam-messagedata-chunkcount: 1 x-ms-exchange-antispam-messagedata-0: =?iso-8859-1?q?nvfxgqPUz9z6qWaCoQMNN9x?= =?iso-8859-1?q?ZLDMjcCl+jTEKnQiv09c68FOsn0PQW+Zz4/RHU4r1RpEI1Z1VfGyPwuBMaDm?= =?iso-8859-1?q?/+WBw+ULc5omSL5hVrz3+lYrcIZ6qxZpY58YTeM49nsXdcyf1N2emTVJTUlM?= =?iso-8859-1?q?NWebp+YgURPvIvZ/wbbz/eCypDhuzmQht6w94QppYd41Q7AAlLGZYgyLpN4m?= =?iso-8859-1?q?WijT/59QvRynCFdI8bqeh3UdP4ZPKKxHaO81nnsphgj1vGesv54eb17xP1qN?= =?iso-8859-1?q?cqLsFBgLxeYJ3KM90lPefKjOINMly+NoqqWiUs2QrJIUnApo+Ls8MSlqPRc3?= =?iso-8859-1?q?E56B2URc39regxSavKrhyWxmBnp6KLgFMwkY6rvc3iVqYHRjPCznmHuLh/hW?= =?iso-8859-1?q?/5rGJNjQM62Meb1VozWNWtmdbQIziudxy/nzKQgHNuWvJqvAtJyF2WhpRYON?= =?iso-8859-1?q?4jR5i4IMfPjRl3XBa20329xwzalzB2Of9XfD1yOBDhX/g0bNZk/iYcDmcYW9?= =?iso-8859-1?q?OvcVjTZoXb0cLjMEsfxzkzTbTHN5PtI75tqqHaaksqZ5aq9eE5xiJkC7uube?= =?iso-8859-1?q?LbM1myElUa0wNZNrVI/hR5GoHNLclXlkCn1P+kpikPqra70V/FXOHJLYufm5?= =?iso-8859-1?q?P5+A/yy/RE541s1WwK3hnsSpMzNMtwEvHrO0JSqxYcWl+e/I2wf2ZCuKRZxl?= =?iso-8859-1?q?aJg2Pfm9OoNvgju8dNFSNARUAyAXyJTcSteddObMXVZjjdFuW9CBgcZcyZ9a?= =?iso-8859-1?q?TCaChbgsh+qaBq4OVMtRFA8iYXVLFPrnp5BW9/4PmK9B/Yf8oEgjFnECUnph?= =?iso-8859-1?q?LLmbFIn0KW2ToeZPuZV/D689u13W687L+xw0lDioIK/EdCmdTC8gUqculx+N?= =?iso-8859-1?q?RUvo1Comy0+jRCWl0ueBWvwFJMLzahfeQCxFJwlFjg1CO6aaW+Jd4Jt4K5vk?= =?iso-8859-1?q?QBdkIgwafwJ4nHbIMeSjGeT2NhayWlQGk95+MbMNdr+9R9rk4E0phaiPxBG+?= =?iso-8859-1?q?aSvZI66gHkb8GOqt9KgCLLdkL6bo2f+HqcMMRHy/o5wXaImAxS449jKio+79?= =?iso-8859-1?q?KbDOS/1VxeyB755Eoxof4hSUibtpbVyYe0B7PC4wQcb3aZibKLwDb5+fSN3/?= =?iso-8859-1?q?A7aruDDovIyHh7KXRjz8jXGn6BsrjtLQFwW+quyWzony0FNGyHn/Jy+RKMfw?= =?iso-8859-1?q?yYEaRoqE9uf8H1+BfefU1NCs+u0mVjhXIZ5tugGn9aytyQ46gWCA83eg2lv/?= =?iso-8859-1?q?7jmN+WIC8WxrKAEUXv4B8n3OT6lrEbh6XV53TF115xJ+JA1qPgu4uUATW?= Content-Type: multipart/mixed; boundary="_004_PAVPR10MB686294D1DE898DAF7D10EDAA991A2PAVPR10MB6862EURP_" MIME-Version: 1.0 X-OriginatorOrg: outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-AuthSource: PAVPR10MB6862.EURPRD10.PROD.OUTLOOK.COM X-MS-Exchange-CrossTenant-RMS-PersistedConsumerOrg: 00000000-0000-0000-0000-000000000000 X-MS-Exchange-CrossTenant-Network-Message-Id: f9f77559-1e15-488b-7b50-08dd363e8809 X-MS-Exchange-CrossTenant-originalarrivaltime: 16 Jan 2025 15:00:35.4364 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: 84df9e7f-e9f6-40af-b435-aaaaaaaaaaaa X-MS-Exchange-CrossTenant-rms-persistedconsumerorg: 00000000-0000-0000-0000-000000000000 X-MS-Exchange-Transport-CrossTenantHeadersStamped: AS2PR10MB6448 X-Spam-Status: No, score=-12.8 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, FREEMAIL_FROM, GIT_PATCH_0, HTML_MESSAGE, RCVD_IN_DNSWL_NONE, SPF_HELO_PASS, SPF_PASS, TXREP autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on server2.sourceware.org X-BeenThere: newlib@sourceware.org X-Mailman-Version: 2.1.30 Precedence: list List-Id: Newlib mailing list <newlib.sourceware.org> List-Unsubscribe: <https://sourceware.org/mailman/options/newlib>, <mailto:newlib-request@sourceware.org?subject=unsubscribe> List-Archive: <https://sourceware.org/pipermail/newlib/> List-Post: <mailto:newlib@sourceware.org> List-Help: <mailto:newlib-request@sourceware.org?subject=help> List-Subscribe: <https://sourceware.org/mailman/listinfo/newlib>, <mailto:newlib-request@sourceware.org?subject=subscribe> Errors-To: newlib-bounces~patchwork=sourceware.org@sourceware.org |
Series |
Fixes compile failure if REENTRANT_SYSCALLS_PROVIDED and MISSING_SYSCALL_NAMES defined
|
|
Commit Message
Markus Eisenmann
Jan. 16, 2025, 3 p.m. UTC
Hi!
The attached patch will fix some compiler issues if the macros REENTRANT_SYSCALLS_PROVIDED and MISSING_SYSCALL_NAMES ...
In case of stdio/fopen.c and stdio64/fopen64.c compiling with a newer compiler like GCC 14.2 will
abort with an error like "implicit declaration of ...", because the open() - as replacement of _open_r (see reent.h) -
isn't declared; I.e., including <fcntl.h> unconditionaly fixes this compile-issue.
Note: Older GCC's are more "relaxed" and - for example GCC 11.3 - does not warn about this implicit declaration ?!
Another similar issue was replacing _rename_r by rename() in stdio/rename.c whitch caused a "forever-
loop" or stack-overflow by recursion - depending on the optimization level.
Best regards from Austria,
Markus
From 020ef623fa0e49cf3c346ff0df53376c29a65f33 Mon Sep 17 00:00:00 2001
From: Markus Eisenmann <markus.eisenmann@outlook.com>
Date: Thu, 16 Jan 2025 15:13:54 +0100
Subject: [PATCH] Fixes compile failure if REENTRANT_SYSCALLS_PROVIDED and
MISSING_SYSCALL_NAMES defined
If the macros REENTRANT_SYSCALLS_PROVIDED and MISSING_SYSCALL_NAMES are defined some
_reent_*-functions are replaced by the system-call and this leads to compile-warning
or a runtime-failure.
* newlib/libc/stdio/fopen.c _open_r is replaces by open(), declared in <fcntl.h>
* newlib/libc/stdio64/fopen64.c ditto
* newlib/libc/stdio/rename.c _rename_r is rename() itself; i.e, fix recursion
---
newlib/libc/stdio/fopen.c | 2 --
newlib/libc/stdio/rename.c | 3 ++-
newlib/libc/stdio64/fopen64.c | 2 --
3 files changed, 2 insertions(+), 5 deletions(-)
Comments
On Jan 16 15:00, Markus Eisenmann wrote: > Hi! > > The attached patch will fix some compiler issues if the macros REENTRANT_SYSCALLS_PROVIDED and MISSING_SYSCALL_NAMES ... > > In case of stdio/fopen.c and stdio64/fopen64.c compiling with a newer compiler like GCC 14.2 will > abort with an error like "implicit declaration of ...", because the open() - as replacement of _open_r (see reent.h) - > isn't declared; I.e., including <fcntl.h> unconditionaly fixes this compile-issue. > Note: Older GCC's are more "relaxed" and - for example GCC 11.3 - does not warn about this implicit declaration ?! > > Another similar issue was replacing _rename_r by rename() in stdio/rename.c whitch caused a "forever- > loop" or stack-overflow by recursion - depending on the optimization level. > > Best regards from Austria, > Markus > From 020ef623fa0e49cf3c346ff0df53376c29a65f33 Mon Sep 17 00:00:00 2001 > From: Markus Eisenmann <markus.eisenmann@outlook.com> > Date: Thu, 16 Jan 2025 15:13:54 +0100 > Subject: [PATCH] Fixes compile failure if REENTRANT_SYSCALLS_PROVIDED and > MISSING_SYSCALL_NAMES defined > > If the macros REENTRANT_SYSCALLS_PROVIDED and MISSING_SYSCALL_NAMES are defined some > _reent_*-functions are replaced by the system-call and this leads to compile-warning > or a runtime-failure. > > * newlib/libc/stdio/fopen.c _open_r is replaces by open(), declared in <fcntl.h> > * newlib/libc/stdio64/fopen64.c ditto > * newlib/libc/stdio/rename.c _rename_r is rename() itself; i.e, fix recursion > --- > newlib/libc/stdio/fopen.c | 2 -- > newlib/libc/stdio/rename.c | 3 ++- > newlib/libc/stdio64/fopen64.c | 2 -- > 3 files changed, 2 insertions(+), 5 deletions(-) Pushed. Thanks, Corinna
diff --git a/newlib/libc/stdio/fopen.c b/newlib/libc/stdio/fopen.c index 1ac551fed..8239fd6b6 100644 --- a/newlib/libc/stdio/fopen.c +++ b/newlib/libc/stdio/fopen.c @@ -107,9 +107,7 @@ static char sccsid[] = "%W% (Berkeley) %G%"; #include <stdio.h> #include <errno.h> #include <sys/lock.h> -#ifdef __CYGWIN__ #include <fcntl.h> -#endif #include "local.h" FILE * diff --git a/newlib/libc/stdio/rename.c b/newlib/libc/stdio/rename.c index 16ef3e351..9abc0d39b 100644 --- a/newlib/libc/stdio/rename.c +++ b/newlib/libc/stdio/rename.c @@ -51,7 +51,8 @@ Supporting OS subroutines required: <<link>>, <<unlink>>, or <<rename>>. #include <stdio.h> #include <sys/unistd.h> -#ifndef _REENT_ONLY +#if !defined(_REENT_ONLY) && !( \ + defined(REENTRANT_SYSCALLS_PROVIDED) && defined(MISSING_SYSCALL_NAMES)) int rename (const char *old, diff --git a/newlib/libc/stdio64/fopen64.c b/newlib/libc/stdio64/fopen64.c index 75d2c2c41..4eee1f273 100644 --- a/newlib/libc/stdio64/fopen64.c +++ b/newlib/libc/stdio64/fopen64.c @@ -56,9 +56,7 @@ static char sccsid[] = "%W% (Berkeley) %G%"; #include <stdio.h> #include <errno.h> #include "local.h" -#ifdef __CYGWIN__ #include <fcntl.h> -#endif #include <sys/lock.h> #ifdef __LARGE64_FILES