Bug 85904 - [7/8 Regression] configure issue cross compiling on netbsd, with patch
Summary: [7/8 Regression] configure issue cross compiling on netbsd, with patch
Status: RESOLVED FIXED
Alias: None
Product: gcc
Classification: Unclassified
Component: target (show other bugs)
Version: 9.0
: P2 normal
Target Milestone: 7.4
Assignee: Jonathan Wakely
URL:
Keywords: build
Depends on:
Blocks:
 
Reported: 2018-05-24 13:06 UTC by coypu
Modified: 2018-08-13 19:16 UTC (History)
1 user (show)

See Also:
Host: x86_64--netbsd
Target: alpha--netbsd
Build:
Known to work: 6.4.0
Known to fail: 7.3.0, 8.1.0, 9.0
Last reconfirmed: 2018-05-24 00:00:00


Attachments
Fixes configure for me (1016 bytes, application/mbox)
2018-05-24 13:06 UTC, coypu
Details

Note You need to log in before you can comment on or make changes to this bug.
Description coypu 2018-05-24 13:06:54 UTC
Created attachment 44175 [details]
Fixes configure for me

Out of the box (+3 patches I would like to get merged) I got:

/home/fly/gcc/libstdc++-v3/libsupc++/new_opa.cc:62:1: error: 'void* aligned_alloc(std::size_t, std::size_t)' was declared 'extern' and later 'static' [-fpermissive]
 aligned_alloc (std::size_t al, std::size_t sz)
 ^~~~~~~~~~~~~
In file included from /tmp/build/alpha--netbsd/libstdc++-v3/include/cstdlib:75,
                 from /tmp/build/alpha--netbsd/libstdc++-v3/include/stdlib.h:36,
                 from /home/fly/gcc/libstdc++-v3/libsupc++/new_opa.cc:27:
/tmp/build/gcc/include-fixed/stdlib.h:254:7: note: previous declaration of 'void* aligned_alloc(size_t, size_t)'
 void *aligned_alloc(size_t, size_t);
       ^~~~~~~~~~~~~


I took the liberty to modify configure following similar platform examples.
with the patches I can build trunk.
Yes I will also email it to gcc-patches.
Comment 1 Jonathan Wakely 2018-05-24 14:57:46 UTC
(In reply to coypu from comment #0)
> Yes I will also email it to gcc-patches.

Please CC the libstdc++ list too.
Comment 2 Jonathan Wakely 2018-05-24 15:21:42 UTC
I'm marking this as a regression in gcc 7 and later, because r240056 (which added the aligned_alloc configure check for native compilers) first appeared in gcc-7
Comment 3 Jonathan Wakely 2018-05-24 15:32:24 UTC
Patch posted: https://gcc.gnu.org/ml/gcc-patches/2018-05/msg01366.html
Comment 4 Jonathan Wakely 2018-05-24 17:31:51 UTC
Author: redi
Date: Thu May 24 17:31:13 2018
New Revision: 260678

URL: https://gcc.gnu.org/viewcvs?rev=260678&root=gcc&view=rev
Log:
PR target/85904 check for aligned_alloc on netbsd cross-compilation

2018-05-24  Maya Rashish  <coypu@sdf.org>

	PR target/85904
	* crossconfig.m4: Test for aligned_alloc on netbsd.
	* configure: Regenerate.

Modified:
    trunk/libstdc++-v3/ChangeLog
    trunk/libstdc++-v3/configure
    trunk/libstdc++-v3/crossconfig.m4
Comment 5 Jonathan Wakely 2018-07-04 11:47:13 UTC
Author: redi
Date: Wed Jul  4 11:45:51 2018
New Revision: 262390

URL: https://gcc.gnu.org/viewcvs?rev=262390&root=gcc&view=rev
Log:
PR target/85904 check for aligned_alloc on netbsd cross-compilation

Backport from mainline
2018-05-24  Maya Rashish  <coypu@sdf.org>

	PR target/85904
	* crossconfig.m4: Test for aligned_alloc on netbsd.
	* configure: Regenerate.

Modified:
    branches/gcc-8-branch/libstdc++-v3/ChangeLog
    branches/gcc-8-branch/libstdc++-v3/configure
    branches/gcc-8-branch/libstdc++-v3/crossconfig.m4
Comment 6 Jonathan Wakely 2018-07-04 13:59:53 UTC
Author: redi
Date: Wed Jul  4 13:59:17 2018
New Revision: 262406

URL: https://gcc.gnu.org/viewcvs?rev=262406&root=gcc&view=rev
Log:
PR target/85904 check for aligned_alloc on netbsd cross-compilation

Backport from mainline
2018-05-24  Maya Rashish  <coypu@sdf.org>

	PR target/85904
	* crossconfig.m4: Test for aligned_alloc on netbsd.
	* configure: Regenerate.

Modified:
    branches/gcc-7-branch/libstdc++-v3/ChangeLog
    branches/gcc-7-branch/libstdc++-v3/configure
    branches/gcc-7-branch/libstdc++-v3/crossconfig.m4
Comment 7 Jonathan Wakely 2018-07-04 14:36:06 UTC
Fixed for 7.4 and 8.2
Comment 8 Sebastian Huber 2018-08-08 08:26:06 UTC
This bug affects also all Newlib targets.  However, the configure checks in GLIBCXX_CROSSCONFIG do not work here, due to this Newlib speciality in libstdc++-v3/configure.ac:

  # First, test for "known" system libraries.  We may be using newlib even
  # on a hosted environment.
  if test "x${with_newlib}" = "xyes"; then
Comment 9 sh 2018-08-10 06:28:08 UTC
Author: sh
Date: Fri Aug 10 06:27:35 2018
New Revision: 263461

URL: https://gcc.gnu.org/viewcvs?rev=263461&root=gcc&view=rev
Log:
libstdc++-v3: Have aligned_alloc() on Newlib

While building for Newlib, some configure checks must be hard coded.
The aligned_alloc() is supported since 2015 in Newlib.

libstdc++-v3/

	PR target/85904
	* configure.ac: Define HAVE_ALIGNED_ALLOC if building for
	Newlib.
	* configure: Regenerate.

Modified:
    trunk/libstdc++-v3/ChangeLog
    trunk/libstdc++-v3/configure
    trunk/libstdc++-v3/configure.ac
Comment 10 sh 2018-08-10 06:30:30 UTC
Author: sh
Date: Fri Aug 10 06:29:58 2018
New Revision: 263462

URL: https://gcc.gnu.org/viewcvs?rev=263462&root=gcc&view=rev
Log:
libstdc++-v3: Have aligned_alloc() on Newlib

While building for Newlib, some configure checks must be hard coded.
The aligned_alloc() is supported since 2015 in Newlib.

libstdc++-v3/

	PR target/85904
	* configure.ac: Define HAVE_ALIGNED_ALLOC if building for
	Newlib.
	* configure: Regenerate.

Modified:
    branches/gcc-8-branch/libstdc++-v3/ChangeLog
    branches/gcc-8-branch/libstdc++-v3/configure
    branches/gcc-8-branch/libstdc++-v3/configure.ac
Comment 11 sh 2018-08-10 06:32:35 UTC
Author: sh
Date: Fri Aug 10 06:31:57 2018
New Revision: 263463

URL: https://gcc.gnu.org/viewcvs?rev=263463&root=gcc&view=rev
Log:
libstdc++-v3: Have aligned_alloc() on Newlib

While building for Newlib, some configure checks must be hard coded.
The aligned_alloc() is supported since 2015 in Newlib.

libstdc++-v3/

	PR target/85904
	* configure.ac: Define HAVE_ALIGNED_ALLOC if building for
	Newlib.
	* configure: Regenerate.

Modified:
    branches/gcc-7-branch/libstdc++-v3/ChangeLog
    branches/gcc-7-branch/libstdc++-v3/configure
    branches/gcc-7-branch/libstdc++-v3/configure.ac
Comment 12 Jonathan Wakely 2018-08-13 18:54:53 UTC
Author: redi
Date: Mon Aug 13 18:54:21 2018
New Revision: 263513

URL: https://gcc.gnu.org/viewcvs?rev=263513&root=gcc&view=rev
Log:
Revert "libstdc++-v3: Have aligned_alloc() on Newlib"

This reverts commit r263461 / 2e920cd849b3cf0a72df4f172e27676a3e70b73f
because aligned_alloc is not defined for baremetal newlib targets, see
https://gcc.gnu.org/ml/libstdc++/2018-08/msg00065.html

Revert
2018-08-10  Sebastian Huber  <sebastian.huber@embedded-brains.de>

	PR target/85904
	* configure.ac: Define HAVE_ALIGNED_ALLOC if building for
	Newlib.
	* configure: Regenerate.

Modified:
    trunk/libstdc++-v3/ChangeLog
    trunk/libstdc++-v3/configure
    trunk/libstdc++-v3/configure.ac
Comment 13 Jonathan Wakely 2018-08-13 19:16:30 UTC
Author: redi
Date: Mon Aug 13 19:15:40 2018
New Revision: 263517

URL: https://gcc.gnu.org/viewcvs?rev=263517&root=gcc&view=rev
Log:
Revert "libstdc++-v3: Have aligned_alloc() on Newlib"

This reverts commit r263462 / 61b760a78fdf9f5d87b0b626a61a3216bd1411fc
because aligned_alloc is not defined for baremetal newlib targets, see
https://gcc.gnu.org/ml/libstdc++/2018-08/msg00065.html

Revert
2018-08-10  Sebastian Huber  <sebastian.huber@embedded-brains.de>

	PR target/85904
	* configure.ac: Define HAVE_ALIGNED_ALLOC if building for
	Newlib.
	* configure: Regenerate.

Modified:
    branches/gcc-8-branch/libstdc++-v3/ChangeLog
    branches/gcc-8-branch/libstdc++-v3/configure
    branches/gcc-8-branch/libstdc++-v3/configure.ac
Comment 14 Jonathan Wakely 2018-08-13 19:16:34 UTC
Author: redi
Date: Mon Aug 13 19:16:02 2018
New Revision: 263518

URL: https://gcc.gnu.org/viewcvs?rev=263518&root=gcc&view=rev
Log:
Revert "libstdc++-v3: Have aligned_alloc() on Newlib"

This reverts commit r263463 / b7edd52337828cc46e469bca12f58288795b78d5
because aligned_alloc is not defined for baremetal newlib targets, see
https://gcc.gnu.org/ml/libstdc++/2018-08/msg00065.html

Revert
2018-08-10  Sebastian Huber  <sebastian.huber@embedded-brains.de>

	PR target/85904
	* configure.ac: Define HAVE_ALIGNED_ALLOC if building for
	Newlib.
	* configure: Regenerate.

Modified:
    branches/gcc-7-branch/libstdc++-v3/ChangeLog
    branches/gcc-7-branch/libstdc++-v3/configure
    branches/gcc-7-branch/libstdc++-v3/configure.ac