Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

using the macro BUILD_APPLE_M1 set by configure prevents a universal build #617

Open
atncsj6h opened this issue Jan 25, 2024 · 18 comments
Open
Assignees
Labels
A Apple/Mac issue (i.e. something that doesn't seem to occur on Windows or Linux.) BUG The issue describes likely incorrect product functionality that likely needs corrected. HELP! Help is needed from someone more experienced or I'm simply overloaded with too much work right now! Ongoing Issue is long-term. Variant of IN PROGRESS: it's being worked on but maybe not at this exact moment.

Comments

@atncsj6h
Copy link

the title tells

no need to bother configure.ac
for this checks the builtin compiler macros should be used

generic

# if defined( __APPLE__ ) 
# endif

will use the qos constructs also for x86_64 processors
I do not know what happens under the covers but an arm64 universal works on a macbook Intel

more granularity / pickyness

# if defined( __APPLE__ ) && defined( __arm64 )
# endif

the compiler will use the qos contructs for arm
the old constructs for x86_64

e

P.S.

cc -E -dM - </dev/null |sort > compiler_macros.h

should always be run when updating the compiler
to find the new macros available

@wrljet
Copy link
Member

wrljet commented Jan 25, 2024

Good idea.

@Fish-Git
Copy link
Member

I'm afraid I do not understand the problem you are reporting, nor what your suggested fix for the problem is, Enrico. "the title tells" is not enough for me. I am not familiar with Apple "Universal" builds.

Do you have a patch for us?

(Bill? Do you understand what Enrico is saying?)

@Fish-Git Fish-Git added BUG The issue describes likely incorrect product functionality that likely needs corrected. HELP! Help is needed from someone more experienced or I'm simply overloaded with too much work right now! QUESTION... A question was asked but has not been answered yet, -OR- additional feedback is requested. Researching... The issue is being looked into or additional information is being gathered/located. A Apple/Mac issue (i.e. something that doesn't seem to occur on Windows or Linux.) labels Jan 25, 2024
@wrljet
Copy link
Member

wrljet commented Jan 25, 2024

Fish,

Yes, I understand. Enrico and I will take care of it.

Bill

@Fish-Git
Copy link
Member

Thanks!

@wrljet
Copy link
Member

wrljet commented Jan 25, 2024

This will be an improvement going forward, but nothing urgent.

@atncsj6h
Copy link
Author

atncsj6h commented Jan 25, 2024

when building a universal binary the apple compiler will logically run twice one time with the __arm64 macro,
and one time with the __amd64/__x86_64 macros and it will take two different paths,
using the BUILD_APPLE_M1 it will take always the same path and it will not distinguish between the two architectures
e

PS
since it looks like I am the only one building universal binaries ,
you just can wait until I check everything again and I can post the final global solution

@Fish-Git
Copy link
Member

when building a universal binary the apple compiler will logically run twice one time with the __arm64 macro,
and one time with the __amd64/__x86_64 macros and it will take two different paths,
using the BUILD_APPLE_M1 it will take always the same path and it will not distinguish between the two architectures

Ah! Okay! That makes sense now. I think I now know what your GitHub Issue is referring to. Thanks, Enrico!

PS
since it looks like I am the only one building universal binaries ,
you just can wait until I check everything again and I can post the final global solution

Thank you. We would appreciate that very much!

@wrljet
Copy link
Member

wrljet commented Jan 25, 2024

You can blame me for how it is now.

When I arrived here SDL Hercules didn't build at all on quite a few platforms, including modern Mac.

What we have now is the result of me buying a Mac M1 at Costco and just dicking with it.
Never touched anything Apple before that.

Bill

@Fish-Git
Copy link
Member

Fish-Git commented Jan 27, 2024

What we have now is the result of me buying a Mac M1 at Costco and just dicking with it.

Lucky you! I wish I could afford one.

Never touched anything Apple before that.

I was a huge fan of the Macintosh when it originally came out oh so many years ago. Bought myself a "Fat" Mac (512K!) with a dot matrix printer and installed a 3rd party internal (10MB!) hard drive! I was in heaven!   :)

Sadly, I had to sell it a few years later for the money.   :(

And of course today, I'm so dirt poor I couldn't get out of sight if it cost a quarter (25 cents) to go around the world!   :`(

@Fish-Git Fish-Git added IN PROGRESS... I'm working on it! (Or someone else is!) Ongoing Issue is long-term. Variant of IN PROGRESS: it's being worked on but maybe not at this exact moment. and removed QUESTION... A question was asked but has not been answered yet, -OR- additional feedback is requested. Researching... The issue is being looked into or additional information is being gathered/located. labels Feb 8, 2024
@Fish-Git
Copy link
Member

Bill Lewis (@wrljet) wrote:

Yes, I understand. Enrico and I will take care of it.

Enrico Sorichetti (@atncsj6h) wrote:

since it looks like I am the only one building universal binaries ,
you just can wait until I check everything again and I can post the final global solution

(Ping!)  How's is going, guys?  Still no rush. Just curious is all.

@atncsj6h
Copy link
Author

atncsj6h commented Feb 14, 2024

I had some personal urgencies to take care of,
so I could not dedicate any time to the IT hobby
( apart lurking )
I' ll be back soon

here the git diff output at the current hyperion level
just the .c .h sources
the config things can be cleaned up later - no hurry
gmake check runs with no errors on apple Mx processor

@Fish-Git
Copy link
Member

I had some personal urgencies to take care of,
so I could not dedicate any time to the IT hobby
( apart lurking )
I' ll be back soon

My best wishes and thoughts go out to you my friend!

here the git diff output at the current hyperion level
just the .c .h sources
the config things can be cleaned up later - no hurry
gmake check runs with no errors on apple Mx processor

Thanks! I'll take a peek at them and then probably go ahead and commit them if they look okay (which I'm sure they will).

Good luck with your personal urgency! I wish you nothing but the best, and hope things go well for you. Take care, my friend.

@atncsj6h
Copy link
Author

My best wishes and thoughts go out to you my friend!

thank you,
nothing to worry about, just some very annoying house administrative stuff

@Fish-Git
Copy link
Member

Fish-Git commented Apr 6, 2024

(PING!)

How's it going you two? Is this issue resolved yet? Any progress? are you still working on it? Or can it be closed?

Just interested in a status update, that's all. If I should leave it open, fine. Just let me know. Thanks.

@wrljet
Copy link
Member

wrljet commented Apr 6, 2024

Please don't close. Still needs to be addressed. Just lot of other stuff going on.

@Fish-Git
Copy link
Member

Fish-Git commented Apr 6, 2024

No problem. I was just under the impression that it was a fairly simple and straightforward thing, that's all. Sorry to bother you. Will keep open as long as needed.

@Fish-Git Fish-Git removed the IN PROGRESS... I'm working on it! (Or someone else is!) label Apr 6, 2024
@Fish-Git
Copy link
Member

Fish-Git commented May 4, 2024

(PING!)

Status?

@Fish-Git
Copy link
Member

(PING!?!)

Status?!?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A Apple/Mac issue (i.e. something that doesn't seem to occur on Windows or Linux.) BUG The issue describes likely incorrect product functionality that likely needs corrected. HELP! Help is needed from someone more experienced or I'm simply overloaded with too much work right now! Ongoing Issue is long-term. Variant of IN PROGRESS: it's being worked on but maybe not at this exact moment.
Projects
None yet
Development

No branches or pull requests

3 participants