Skip to content

Commit

Permalink
gcc48: fix build error on netbsd/arm
Browse files Browse the repository at this point in the history
configs for gcc on netbsd don't build -march=native support, but this
stray prototype was left, causing build errors:

gcc.o:(.rodata+0x58c4): undefined reference to
`host_detect_local_cpu(int, char const**)'
  • Loading branch information
maya committed Sep 25, 2016
1 parent ee15e99 commit 7b6e029
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 1 deletion.
3 changes: 2 additions & 1 deletion lang/gcc48/distinfo
@@ -1,4 +1,4 @@
$NetBSD: distinfo,v 1.31 2016/09/15 17:56:23 maya Exp $
$NetBSD: distinfo,v 1.32 2016/09/25 23:09:34 maya Exp $

SHA1 (ecj-4.5.jar) = 58c1d79c64c8cd718550f32a932ccfde8d1e6449
RMD160 (ecj-4.5.jar) = d3f4da657f086b6423f74e93f001132f4855368a
Expand Down Expand Up @@ -29,6 +29,7 @@ SHA1 (patch-gcc_builtins.c) = 67c66568237b68b22ba99bc76336e001e1634925
SHA1 (patch-gcc_c-family_c-format.c) = 485ebb16ff3c0c785678326ff4d622c865849850
SHA1 (patch-gcc_config.gcc) = 1a697bcc295c40bc1bbed6295f53854d56df9f93
SHA1 (patch-gcc_config.host) = 1b1e11cd199eb93f49443d51c0063b09b7327858
SHA1 (patch-gcc_config_arm_arm.h) = 92887392b19018d20f015de78d16ce32f2986e7a
SHA1 (patch-gcc_config_darwin.c) = caff312fbc948a1c2730decbab435dbd3caa203f
SHA1 (patch-gcc_config_dragonfly-stdint.h) = 740dc819b446d5f1476506322c4b280ffdb5a6c0
SHA1 (patch-gcc_config_dragonfly.h) = 82f549cdc7543b4bf413a44d481ef42b10f59c82
Expand Down
18 changes: 18 additions & 0 deletions lang/gcc48/patches/patch-gcc_config_arm_arm.h
@@ -0,0 +1,18 @@
$NetBSD: patch-gcc_config_arm_arm.h,v 1.1 2016/09/25 23:09:35 maya Exp $

Don't declare a prototype used for -march=native, avoids build error on netbsd/arm:
gcc.o:(.rodata+0x58c4): undefined reference to `host_detect_local_cpu(int, char const**)'

same change is used in netbsd base gcc.

--- gcc/config/arm/arm.h.orig 2015-01-14 11:02:24.000000000 +0000
+++ gcc/config/arm/arm.h
@@ -2315,7 +2315,7 @@ extern int making_const_table;

/* -mcpu=native handling only makes sense with compiler running on
an ARM chip. */
-#if defined(__arm__)
+#if defined(__arm__) && !defined(__NetBSD__)
extern const char *host_detect_local_cpu (int argc, const char **argv);
# define EXTRA_SPEC_FUNCTIONS \
{ "local_cpu_detect", host_detect_local_cpu },

0 comments on commit 7b6e029

Please sign in to comment.