public inbox for newlib@sourceware.org
 help / color / mirror / Atom feed
* gcc 14+ and m68k build failure
@ 2024-06-02 15:58 Joel Sherrill
  2024-06-03 16:44 ` Hans-Bernhard Bröker
  2024-06-04  1:02 ` Pietro Monteiro
  0 siblings, 2 replies; 4+ messages in thread
From: Joel Sherrill @ 2024-06-02 15:58 UTC (permalink / raw)
  To: Newlib

[-- Attachment #1: Type: text/plain, Size: 1311 bytes --]

Hi

GCC 14+ fail to build a few newlib targets. I am looking into m68k-rtems
(m68k-elf) first. If there is a common thread, it appears to be related to
targets which do not have long double in all multilibs.

First, how do you see more than "CC..file.c"?

The error for m68k starts with this:

ake[3]: Entering directory
'/home/joel/test-gcc/b-m68k-rtems6-gcc/m68k-rtems6/newlib'
  CC       libm/complex/libm_a-ccoshl.o
../../../gcc/newlib/libm/complex/ccoshl.c: In function 'ccoshl':
../../../gcc/newlib/libm/complex/ccoshl.c:43:13: error: implicit
declaration of function 'coshl'; did you mean 'coshf'?
[-Wimplicit-function-declaration]
   43 |         w = coshl(x) * cosl(y) + (sinhl(x) * sinl(y)) * I;
      |             ^~~~~
      |             coshf
../../../gcc/newlib/libm/complex/ccoshl.c:43:24: error: implicit
declaration of function 'cosl'; did you mean 'cosf'?
[-Wimplicit-function-declaration]
   43 |         w = coshl(x) * cosl(y) + (sinhl(x) * sinl(y)) * I;


I suspect that since only one multilib for m68k has multilib and that is
picked at compile time, the multilib here isn't enabling the prototypes for
long double. That idea seems right but the code doesn't seem to always
follow up to avoid trying to compile files like the above which assume long
double.

Ideas appreciated.

--joel

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: gcc 14+ and m68k build failure
  2024-06-02 15:58 gcc 14+ and m68k build failure Joel Sherrill
@ 2024-06-03 16:44 ` Hans-Bernhard Bröker
  2024-06-04  1:02 ` Pietro Monteiro
  1 sibling, 0 replies; 4+ messages in thread
From: Hans-Bernhard Bröker @ 2024-06-03 16:44 UTC (permalink / raw)
  To: Joel Sherrill, Newlib

Am 02.06.2024 um 17:58 schrieb Joel Sherrill:

> First, how do you see more than "CC..file.c"?

Run configure with "--disable-silent-rules", or run make with an 
argument of "V=1".

If you're sure you never want this, you can add "enable_silent_rules=no" 
to your local or personal "config.site" file.

For the gory details, please see

	info automake silencing Automake


^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: gcc 14+ and m68k build failure
  2024-06-02 15:58 gcc 14+ and m68k build failure Joel Sherrill
  2024-06-03 16:44 ` Hans-Bernhard Bröker
@ 2024-06-04  1:02 ` Pietro Monteiro
  2024-06-04  1:41   ` Pietro Monteiro
  1 sibling, 1 reply; 4+ messages in thread
From: Pietro Monteiro @ 2024-06-04  1:02 UTC (permalink / raw)
  To: Joel Sherrill, Newlib

On Sun, Jun 2, 2024, at 8:58 AM, Joel Sherrill wrote:
> Hi
>
> GCC 14+ fail to build a few newlib targets. I am looking into m68k-rtems
> (m68k-elf) first. If there is a common thread, it appears to be related to
> targets which do not have long double in all multilibs.

The same thing is happening on SH for the m4-single-only multilib.

> First, how do you see more than "CC..file.c"?

Add `V=1' to you make invocation.
 
> The error for m68k starts with this:
>
> ake[3]: Entering directory
> '/home/joel/test-gcc/b-m68k-rtems6-gcc/m68k-rtems6/newlib'
>   CC       libm/complex/libm_a-ccoshl.o
> ../../../gcc/newlib/libm/complex/ccoshl.c: In function 'ccoshl':
> ../../../gcc/newlib/libm/complex/ccoshl.c:43:13: error: implicit
> declaration of function 'coshl'; did you mean 'coshf'?
> [-Wimplicit-function-declaration]
>    43 |         w = coshl(x) * cosl(y) + (sinhl(x) * sinl(y)) * I;
>       |             ^~~~~
>       |             coshf
> ../../../gcc/newlib/libm/complex/ccoshl.c:43:24: error: implicit
> declaration of function 'cosl'; did you mean 'cosf'?
> [-Wimplicit-function-declaration]
>    43 |         w = coshl(x) * cosl(y) + (sinhl(x) * sinl(y)) * I;
>
>
> I suspect that since only one multilib for m68k has multilib and that is
> picked at compile time, the multilib here isn't enabling the prototypes for
> long double. That idea seems right but the code doesn't seem to always
> follow up to avoid trying to compile files like the above which assume long
> double.

I think I understand what's going on. `_LDBL_EQ_DBL' is not being defined for that multilib. So, functions like `coshl' aren't compiled (see newlib/libm/common/coshl.c), but the complex versions of the functions don't have the `#ifdef _LDBL_EQ_DBL' guard around them (see: newlib/libm/complex/ccoshl.c). And GCC 14 changed the lack of a function declaration from a warning into an error.

> Ideas appreciated.

I'll try to post a patch adding the ifdefs to add long double complex functions. 

> --joel

pietro

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: gcc 14+ and m68k build failure
  2024-06-04  1:02 ` Pietro Monteiro
@ 2024-06-04  1:41   ` Pietro Monteiro
  0 siblings, 0 replies; 4+ messages in thread
From: Pietro Monteiro @ 2024-06-04  1:41 UTC (permalink / raw)
  To: Joel Sherrill, Newlib

On Mon, Jun 3, 2024, at 9:02 PM, Pietro Monteiro wrote:

> I'll try to post a patch adding the ifdefs to add long double complex 
> functions. 

Can you try my the patch i just sent[0]?

[0] https://inbox.sourceware.org/newlib/0ca79433-448c-469f-880a-6b228ade4b80@app.fastmail.com/

pietro.

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2024-06-04  1:41 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2024-06-02 15:58 gcc 14+ and m68k build failure Joel Sherrill
2024-06-03 16:44 ` Hans-Bernhard Bröker
2024-06-04  1:02 ` Pietro Monteiro
2024-06-04  1:41   ` Pietro Monteiro

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).