Plan of action for getting macppc apps to compile with Clang?

classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|

Plan of action for getting macppc apps to compile with Clang?

Ahmed Khanzada
Hey all,

Congratulations on getting clang working on OpenBSD macppc!

My guess is that the next step is ensuring that most macppc ports can
be compiled using clang instead of gcc.

I know that there is probably a lot of busy work here, especially
considering how slow macppc compiles. I would like to help!

I have two questions:

1. Is there a current plan of action that I should be aware of?

2. Are there any notes on common problems when switching over
compilation of an app from GCC to Clang that an OpenBSD developer
should know of? I am using Marc Espie's "clang vs gcc" presentation as
a starting point: https://www.openbsd.org/papers/lse-clang.pdf

Thank you,
Ahmed Khanzada

Reply | Threaded
Open this post in threaded view
|

Re: Plan of action for getting macppc apps to compile with Clang?

Christian Weisgerber
Ahmed Khanzada:

> My guess is that the next step is ensuring that most macppc ports can
> be compiled using clang instead of gcc.

I would think the next step would be to compile the base system and
xenocara with clang.  Somebody needs to try, take note of the
problems they encounter, and start fixing them.

Also, there are two components involved:
(1) switching cc from gcc to clang
(2) switching ld from bfd to lld

These are really separate efforts, but they tend to be lumped
together.

That doesn't mean that there is no value in working on using clang
to build ports on powerpc.  Somebody needs to start.  Run a bulk
build, or any build of a large number of ports, and see what happens.

> 1. Is there a current plan of action that I should be aware of?

There appears to be no plan of action.  The obvious course ahead
is this: Try switching to clang, take note of the problems, fix
what you can, beg and cajole others into fixing what you can't.
Keep pushing.

Somebody needs to step up and JUST DO IT.  For powerpc, that won't
be me.

> 2. Are there any notes on common problems when switching over
> compilation of an app from GCC to Clang that an OpenBSD developer
> should know of?

Well, aarch64/amd64/i386 build everything with clang.  So generally
speaking, the ports tree is just fine with clang.  Whatever problems
you are going to encounter are likely to be architecture-specific.

--
Christian "naddy" Weisgerber                          [hidden email]

Reply | Threaded
Open this post in threaded view
|

Re: Plan of action for getting macppc apps to compile with Clang?

Matthew Hull
On 11/4/19 1:02 PM, Christian Weisgerber wrote:

> Ahmed Khanzada:
>
>> My guess is that the next step is ensuring that most macppc ports can
>> be compiled using clang instead of gcc.
> I would think the next step would be to compile the base system and
> xenocara with clang.  Somebody needs to try, take note of the
> problems they encounter, and start fixing them.
>
> Also, there are two components involved:
> (1) switching cc from gcc to clang
> (2) switching ld from bfd to lld
>
> These are really separate efforts, but they tend to be lumped
> together.
>
> That doesn't mean that there is no value in working on using clang
> to build ports on powerpc.  Somebody needs to start.  Run a bulk
> build, or any build of a large number of ports, and see what happens.
>
>> 1. Is there a current plan of action that I should be aware of?
> There appears to be no plan of action.  The obvious course ahead
> is this: Try switching to clang, take note of the problems, fix
> what you can, beg and cajole others into fixing what you can't.
> Keep pushing.
>
> Somebody needs to step up and JUST DO IT.  For powerpc, that won't
> be me.
>
>> 2. Are there any notes on common problems when switching over
>> compilation of an app from GCC to Clang that an OpenBSD developer
>> should know of?
> Well, aarch64/amd64/i386 build everything with clang.  So generally
> speaking, the ports tree is just fine with clang.  Whatever problems
> you are going to encounter are likely to be architecture-specific.
>
If the base system is built with gcc, does it create problems building
other ports with clang (overriding CC from gcc to clang)?