[prev in list] [next in list] [prev in thread] [next in thread]
List: macports-dev
Subject: Re: Issues with config.h
From: Robert Kennedy <amtor () hotmail ! com>
Date: 2022-08-06 3:23:04
Message-ID: DM4PR10MB601645AB2131698CF39BAA2DAA619 () DM4PR10MB6016 ! namprd10 ! prod ! outlook ! com
[Download RAW message or body]
[Attachment #2 (text/plain)]
Thanks Ryan.
I am torn whether to keep WORDS_BIGENDIAN in the code. Perhaps, I will just leave it \
in the code and see if anyone reports bugs.
This code was compiled my Metakine into a ppc/x86 FAT binary and run without issues \
for many years. So I suspect the WORDS_BIGENDIAN macro was never used in the code \
since as you pointed out Intel Macs are little little-endian.
Rob
________________________________
From: Ryan Schmidt <ryandesign@macports.org>
Sent: August 5, 2022 8:33 PM
To: Robert Kennedy <amtor@hotmail.com>
Cc: MacPorts Developers <macports-dev@lists.macports.org>
Subject: Re: Issues with config.h
On Aug 5, 2022, at 16:43, Robert Kennedy wrote:
>
> I have also patched config.h to address the ARCH issue. It now reads:
>
> #ifndef LINUX
> #if defined(__ppc__) || defined(__ppc64__)
> #define ARCH_PPC
> #elif defined(__i386__)
> #define ARCH_X86
> #elif defined(__x86_64__)
> #define ARCH_X86_64
> #elif defined ((__arm64__) && defined(__APPLE__)) || (__aarch64__)
> #define ARCH_ARM64
> #else
> #define ARCH_X86
> #endif
> #endif
>
> But it looks like ARCH_PPC, ARCH_X86 is not used anywhere in the code. It might \
> have been easier to just remove all this code.
Sure, that's how you could write defines for various architectures, but if they're \
not used in the code there's no point.
I see that ARCH_PPC is used in mpeg2dec/mpeg2_internal.h. I agree I don't see \
anywhere that ARCH_X86 is used.
> I will check whether the code uses WORDS_BIGENDIAN. If not, I will just patch out \
> the problematic code:
> #ifndef LINUX
> #define WORDS_BIGENDIAN 1
> #endif
I agree WORDS_BIGENDIAN is not used anywhere within this project's code, however it \
is a standard define name and I don't know whether it is used in any system headers \
that this project's code might be including.
Code that process endianness incorrectly will probably still compile and run but will \
generate incorrect data. So just the fact that it compiles doesn't mean it's right.
> My portfile already had PortGroup makefile 1.0 so there was no need to \
> add it.
Ah, yes, I missed that. As you've now found, using the makefile portgroup means \
there's no need for you to list "use_configure no"; the fact that you had still \
listed "use_configure no" lead me to the incorrect assumption that you had not used \
the makefile portgroup.
[Attachment #3 (text/html)]
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<style type="text/css" style="display:none;"> P {margin-top:0;margin-bottom:0;} \
</style> </head>
<body dir="ltr">
<div style="font-family: Calibri, Helvetica, sans-serif; font-size: 12pt; color: \
rgb(0, 0, 0);" class="elementToProof"> <span id="" title="" \
class="">Thanks Ryan.</span></div> <div style="font-family: Calibri, Helvetica, \
sans-serif; font-size: 12pt; color: rgb(0, 0, 0);" class="elementToProof"> <span \
title="" class=""><br> </span></div>
<div style="font-family: Calibri, Helvetica, sans-serif; font-size: 12pt; color: \
rgb(0, 0, 0);" class="elementToProof"> <span title="" class="">I am torn whether to \
keep <span style="font-family:"Segoe UI", "Segoe UI Web (West \
European)", "Segoe UI", -apple-system, "system-ui", Roboto, \
"Helvetica Neue", sans-serif;font-size:14.6667px;background-color:rgb(255, \
255, 255);display:inline !important">WORDS_BIGENDIAN in the code. Perhaps, I \
will just leave it in the code and see if anyone reports bugs.</span></span></div> \
<div style="font-family: Calibri, Helvetica, sans-serif; font-size: 12pt; color: \
rgb(0, 0, 0);" class="elementToProof"> <span title="" class=""><span \
style="font-family:"Segoe UI", "Segoe UI Web (West European)", \
"Segoe UI", -apple-system, "system-ui", Roboto, "Helvetica \
Neue", sans-serif;font-size:14.6667px;background-color:rgb(255, 255, \
255);display:inline !important"><br> </span></span></div>
<div style="font-family: Calibri, Helvetica, sans-serif; font-size: 12pt; color: \
rgb(0, 0, 0);" class="elementToProof"> <span title="" class=""><span \
style="font-family:"Segoe UI", "Segoe UI Web (West European)", \
"Segoe UI", -apple-system, "system-ui", Roboto, "Helvetica \
Neue", sans-serif;font-size:14.6667px;background-color:rgb(255, 255, \
255);display:inline !important">This code was compiled my Metakine into a ppc/x86 \
FAT binary and run without issues for many years. </span></span></div> <div \
style="font-family: Calibri, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, \
0);" class="elementToProof"> <span title="" class=""><span \
style="font-family:"Segoe UI", "Segoe UI Web (West European)", \
"Segoe UI", -apple-system, "system-ui", Roboto, "Helvetica \
Neue", sans-serif;font-size:14.6667px;background-color:rgb(255, 255, \
255);display:inline !important">So I suspect the <span \
style="background-color:rgb(255, 255, 255);display:inline !important">WORDS_BIGENDIAN \
macro was never used in the code since as you pointed out Intel Macs are \
little <span style="color:rgb(32, 31, 30);background-color:rgb(255, 255, \
255);display:inline !important">little-endian.</span></span></span></span></div> <div \
style="font-family: Calibri, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, \
0);" class="elementToProof"> <span title="" class=""><span \
style="font-family:"Segoe UI", "Segoe UI Web (West European)", \
"Segoe UI", -apple-system, "system-ui", Roboto, "Helvetica \
Neue", sans-serif;font-size:14.6667px;background-color:rgb(255, 255, \
255);display:inline !important"><span style="background-color:rgb(255, 255, \
255);display:inline !important"><span style="color:rgb(32, 31, \
30);background-color:rgb(255, 255, 255);display:inline !important"><br> \
</span></span></span></span></div> <div style="font-family: Calibri, Helvetica, \
sans-serif; font-size: 12pt; color: rgb(0, 0, 0);" class="elementToProof"> <span \
title="" class=""><span style="font-family:"Segoe UI", "Segoe UI Web \
(West European)", "Segoe UI", -apple-system, "system-ui", \
Roboto, "Helvetica Neue", \
sans-serif;font-size:14.6667px;background-color:rgb(255, 255, 255);display:inline \
!important"><span style="background-color:rgb(255, 255, 255);display:inline \
!important"><span style="color:rgb(32, 31, 30);background-color:rgb(255, 255, \
255);display:inline !important">Rob</span></span></span></span></div> <div \
style="font-family: Calibri, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, \
0);" class="elementToProof"> <span title="" class=""><span \
style="font-family:"Segoe UI", "Segoe UI Web (West European)", \
"Segoe UI", -apple-system, "system-ui", Roboto, "Helvetica \
Neue", sans-serif;font-size:14.6667px;background-color:rgb(255, 255, \
255);display:inline !important"><br> </span></span></div>
<div id="appendonsend"></div>
<hr style="display:inline-block;width:98%" tabindex="-1">
<div id="divRplyFwdMsg" dir="ltr"><font face="Calibri, sans-serif" \
style="font-size:11pt" color="#000000"><b>From:</b> Ryan Schmidt \
<ryandesign@macports.org><br> <b>Sent:</b> August 5, 2022 8:33 PM<br>
<b>To:</b> Robert Kennedy <amtor@hotmail.com><br>
<b>Cc:</b> MacPorts Developers <macports-dev@lists.macports.org><br>
<b>Subject:</b> Re: Issues with config.h</font>
<div> </div>
</div>
<div class="BodyFragment"><font size="2"><span style="font-size:11pt;">
<div class="PlainText">On Aug 5, 2022, at 16:43, Robert Kennedy wrote:<br>
> <br>
> I have also patched config.h to address the ARCH issue. It now reads:<br>
> <br>
> #ifndef LINUX<br>
> #if defined(__ppc__) || \
defined(__ppc64__)<br> > \
#define ARCH_PPC<br> > #elif \
defined(__i386__)<br> > \
#define ARCH_X86<br> > #elif \
defined(__x86_64__)<br> > \
#define ARCH_X86_64<br> \
> #elif defined ((__arm64__) \
&& defined(__APPLE__)) || (__aarch64__)<br> \
> #define \
ARCH_ARM64<br> > #else<br>
> #define \
ARCH_X86<br> > #endif<br>
> #endif<br>
> <br>
> But it looks like ARCH_PPC, ARCH_X86 is not used anywhere in the code. It \
might have been easier to just remove all this code.<br> <br>
Sure, that's how you could write defines for various architectures, but if they're \
not used in the code there's no point.<br> <br>
I see that ARCH_PPC is used in mpeg2dec/mpeg2_internal.h. I agree I don't see \
anywhere that ARCH_X86 is used.<br> <br>
> I will check whether the code uses WORDS_BIGENDIAN. If not, I will just \
patch out the problematic code:<br> > <br>
> #ifndef LINUX<br>
> #define WORDS_BIGENDIAN 1<br>
> #endif<br>
<br>
I agree WORDS_BIGENDIAN is not used anywhere within this project's code, however it \
is a standard define name and I don't know whether it is used in any system headers \
that this project's code might be including.<br> <br>
Code that process endianness incorrectly will probably still compile and run but will \
generate incorrect data. So just the fact that it compiles doesn't mean it's \
right.<br> <br>
<br>
> My portfile already had \
PortGroup makefile 1.0 so \
there was no need to add it.<br> <br>
Ah, yes, I missed that. As you've now found, using the makefile portgroup means \
there's no need for you to list "use_configure no"; the fact that you had \
still listed "use_configure no" lead me to the incorrect assumption that \
you had not used the makefile portgroup.<br>
<br>
<br>
<br>
</div>
</span></font></div>
</body>
</html>
[prev in list] [next in list] [prev in thread] [next in thread]
Configure |
About |
News |
Add a list |
Sponsored by KoreLogic