From mboxrd@z Thu Jan 1 00:00:00 1970 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on inbox.vuxu.org X-Spam-Level: X-Spam-Status: No, score=0.2 required=5.0 tests=DKIM_INVALID,DKIM_SIGNED, HTML_MESSAGE,T_TVD_MIME_EPI autolearn=no autolearn_force=no version=3.4.4 Received: (qmail 14596 invoked from network); 2 Jun 2020 23:30:06 -0000 Received: from bsd.lv (HELO mandoc.bsd.lv) (66.111.2.12) by inbox.vuxu.org with ESMTPUTF8; 2 Jun 2020 23:30:06 -0000 Received: from fantadrom.bsd.lv (localhost [127.0.0.1]) by mandoc.bsd.lv (OpenSMTPD) with ESMTP id 7deaabd3 for ; Tue, 2 Jun 2020 18:30:02 -0500 (EST) Received: from sender4-of-o52.zoho.com (sender4-of-o52.zoho.com [136.143.188.52]) by mandoc.bsd.lv (OpenSMTPD) with ESMTP id 6a46da62 for ; Tue, 2 Jun 2020 18:30:00 -0500 (EST) ARC-Seal: i=1; a=rsa-sha256; t=1591140597; cv=none; d=zohomail.com; s=zohoarc; b=KqxgTY7AWdTXPjz9/QyPs+wrCHhYV0pydNsbYACLvX5U6PwpOejSyxWHJN4JBJDrpf8KUPicvb23el/MnsrkDTP6EQGnDOPdiho9Q7Sk/7EwdTHsOmb4vdI/axf6cl8qvYYDZBHD7czTXV/RMbjJYpwctyiqxrjhArXImEBxRtk= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1591140597; h=Content-Type:Date:From:MIME-Version:Message-ID:Subject:To; bh=ewCyvRypWu5d5UVIYTby/f9hkSonReOa7xrIXD/jDGI=; b=mGybTK/9JyK/7ddgTqBtf3WXX7ZOOElCKeCk+ZXsjTujyp3zXgUIvdg2dnuiTCBQd/noZwTqVOT8cPu5Uv09m6fegz18dE2UbLcK6ckGqprU5k/U6Yk7YRMkurYPex2m79PEkjru4tD3WBHvLY55rFnKuH03QFfIUBgrZfE2MTs= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass header.i=irixnet.org; spf=pass smtp.mailfrom=kazuo@irixnet.org; dmarc=pass header.from= header.from= DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; t=1591140597; s=default; d=irixnet.org; i=kazuo@irixnet.org; h=To:From:Subject:Message-ID:Date:MIME-Version:Content-Type; bh=ewCyvRypWu5d5UVIYTby/f9hkSonReOa7xrIXD/jDGI=; b=ZZ76Ja2mEqo+Xz4Ra8OJNUVOVALOUwUHzQluks0Yop9X4Ct2AoIohVOzS1WHAjcw Fdf7by9Kzt2CnpxVj8XL54YASBTOVrw8vX/fe5RruqdY64BF2PluTw7BUpwIQvRJMy5 2zdT7W9aBpTQabRO++QeUnAKDjr9X/VVfGcqd5GE= Received: from [10.8.253.165] (172.93.226.174 [172.93.226.174]) by mx.zohomail.com with SMTPS id 1591140594634285.7577635346473; Tue, 2 Jun 2020 16:29:54 -0700 (PDT) To: discuss@mandoc.bsd.lv From: Kazuo Kuroi Subject: Patching Mandoc for IRIX Message-ID: Date: Tue, 2 Jun 2020 19:29:52 -0400 User-Agent: Mozilla/5.0 (Windows NT 10.0; WOW64; rv:68.0) Gecko/20100101 Thunderbird/68.8.1 X-Mailinglist: mandoc-discuss Reply-To: discuss@mandoc.bsd.lv MIME-Version: 1.0 Content-Type: multipart/alternative; boundary="------------11D1336CCF50847380B3FF49" Content-Language: en-US X-ZohoMailClient: External This is a multi-part message in MIME format. --------------11D1336CCF50847380B3FF49 Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit Hi there, I have patched mandoc to work with IRIX, but I have a feeling that the fixes made will require some changes. Let me first explain my goals here: I am patching mandoc to work with MIPSPro, the native compiler of IRIX, so I'll have to explain the changes I made to get it to build: http://gitea.irixce.org/Raion/Xenopatches/raw/branch/master/mandoc/mandoc.patch Here's the patch file. First change is because it doesn't reliably detect the c99 driver, and as the code uses non ANSI-related things, it needs to detect c99. This can probably be disregarded, as can the CFLAGS reference. Next one is in mandoc.h, and it's because MIPSPro doesn't support the __attribute__ block. This could be fixed with a guard for non-GCC compilers, like this: #ifdef __GNUC__ __attribute__((__format__ (__printf__, 4, 5))); #endif Or something. I would hope that you won't lock it out to GCC or clang, because I'm sure there's other compilers this thing chokes on. The rest are to fix the IRIX printf() implementation, which doesn't allow for %zu as mandoc currently does. You can see my discussion with a colleague on the topic here: https://forums.irixnet.org/thread-1946-post-14522.html I understand if you do not want to upstream all of these changes, but I would hope that we can take some action to prevent someone else from having to go through this. Surely, this is not the only UNIX that would cause this. Yes, GCC works, but we don't have clang and often times using a GPL compiler isn't only against my own principles when we have perfectly good alternatives, and MIPSPro performs better on IRIX than GCC. If I can be of any assistance or questions in regards to this patch, let me know! -Kazuo Kuroi --------------11D1336CCF50847380B3FF49 Content-Type: text/html; charset=utf-8 Content-Transfer-Encoding: 7bit

Hi there,

I have patched mandoc to work with IRIX, but I have a feeling that the fixes made will require some changes. Let me first explain my goals here:

I am patching mandoc to work with MIPSPro, the native compiler of IRIX, so I'll have to explain the changes I made to get it to build:

http://gitea.irixce.org/Raion/Xenopatches/raw/branch/master/mandoc/mandoc.patch

Here's the patch file.

First change is because it doesn't reliably detect the c99 driver, and as the code uses non ANSI-related things, it needs to detect c99. This can probably be disregarded, as can the CFLAGS reference.

Next one is in mandoc.h, and it's because MIPSPro doesn't support the __attribute__ block. This could be fixed with a guard for non-GCC compilers, like this:
#ifdef __GNUC__
__attribute__((__format__ (__printf__, 4, 5)));

#endif

Or something. I would hope that you won't lock it out to GCC or clang, because I'm sure there's other compilers this thing chokes on.

The rest are to fix the IRIX printf() implementation, which doesn't allow for %zu as mandoc currently does. You can see my discussion with a colleague on the topic here:

https://forums.irixnet.org/thread-1946-post-14522.html

I understand if you do not want to upstream all of these changes, but I would hope that we can take some action to prevent someone else from having to go through this. Surely, this is not the only UNIX that would cause this.

Yes, GCC works, but we don't have clang and often times using a GPL compiler isn't only against my own principles when we have perfectly good alternatives, and MIPSPro performs better on IRIX than GCC.

If I can be of any assistance or questions in regards to this patch, let me know!

-Kazuo Kuroi

--------------11D1336CCF50847380B3FF49-- -- To unsubscribe send an email to discuss+unsubscribe@mandoc.bsd.lv