From 11c638e62d57229828810b7fbdd1bb143808d5a3 Mon Sep 17 00:00:00 2001 From: Patrick Zhang Date: Tue, 4 Feb 2020 21:27:10 +0800 Subject: [PATCH] 8238380: java.base/unix/native/libjava/childproc.c "multiple definition" link errors with GCC10 Reviewed-by: stuefe, clanger, rriggs --- src/java.base/unix/native/libjava/childproc.c | 3 ++- src/java.base/unix/native/libjava/childproc.h | 4 ++-- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/src/java.base/unix/native/libjava/childproc.c b/src/java.base/unix/native/libjava/childproc.c index 77d2488fba7..05d0c8077e5 100644 --- a/src/java.base/unix/native/libjava/childproc.c +++ b/src/java.base/unix/native/libjava/childproc.c @@ -1,5 +1,5 @@ /* - * Copyright (c) 2013, 2019, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2013, 2020, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -34,6 +34,7 @@ #include "childproc.h" +const char * const *parentPathv; ssize_t restartableWrite(int fd, const void *buf, size_t count) diff --git a/src/java.base/unix/native/libjava/childproc.h b/src/java.base/unix/native/libjava/childproc.h index 0911509302c..2190dd17923 100644 --- a/src/java.base/unix/native/libjava/childproc.h +++ b/src/java.base/unix/native/libjava/childproc.h @@ -1,5 +1,5 @@ /* - * Copyright (c) 2013, 2015, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2013, 2020, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -126,7 +126,7 @@ typedef struct _SpawnInfo { * The cached and split version of the JDK's effective PATH. * (We don't support putenv("PATH=...") in native code) */ -const char * const *parentPathv; +extern const char * const *parentPathv; ssize_t restartableWrite(int fd, const void *buf, size_t count); int restartableDup2(int fd_from, int fd_to);