Accepting request 520987 from devel:gcc

- Update nvptx-tools.patch to check for getopt to avoid providing
  an incompatible declaration.

OBS-URL: https://build.opensuse.org/request/show/520987
OBS-URL: https://build.opensuse.org/package/show/openSUSE:Factory/nvptx-tools?expand=0&rev=2
This commit is contained in:
Dominique Leuenberger 2017-09-05 13:19:23 +00:00 committed by Git OBS Bridge
commit 08e4f6f536
3 changed files with 44 additions and 25 deletions

View File

@ -1,3 +1,9 @@
-------------------------------------------------------------------
Tue Sep 5 07:03:59 UTC 2017 - rguenther@suse.com
- Update nvptx-tools.patch to check for getopt to avoid providing
an incompatible declaration.
------------------------------------------------------------------- -------------------------------------------------------------------
Mon Feb 6 14:56:34 UTC 2017 - jengelh@inai.de Mon Feb 6 14:56:34 UTC 2017 - jengelh@inai.de

View File

@ -1,19 +1,20 @@
diff --git a/configure.ac b/configure.ac Index: nvptx-tools/configure.ac
index ecc02c4..7bf8a3f 100644 ===================================================================
--- a/configure.ac --- nvptx-tools.orig/configure.ac 2016-03-10 14:11:40.000000000 +0100
+++ b/configure.ac +++ nvptx-tools/configure.ac 2017-09-05 09:01:50.853212501 +0200
@@ -51,6 +51,7 @@ LIBS="$LIBS -lcuda" @@ -51,6 +51,8 @@ LIBS="$LIBS -lcuda"
AC_CHECK_FUNCS([[cuGetErrorName] [cuGetErrorString]]) AC_CHECK_FUNCS([[cuGetErrorName] [cuGetErrorString]])
AC_CHECK_DECLS([[cuGetErrorName], [cuGetErrorString]], AC_CHECK_DECLS([[cuGetErrorName], [cuGetErrorString]],
[], [], [[#include <cuda.h>]]) [], [], [[#include <cuda.h>]])
+AC_CHECK_HEADERS(unistd.h sys/stat.h) +AC_CHECK_HEADERS(unistd.h sys/stat.h)
+AC_CHECK_DECLS([getopt], [], [], [[#include <unistd.h>]])
AC_MSG_CHECKING([for extra programs to build requiring -lcuda]) AC_MSG_CHECKING([for extra programs to build requiring -lcuda])
NVPTX_RUN= NVPTX_RUN=
diff --git a/include/libiberty.h b/include/libiberty.h Index: nvptx-tools/include/libiberty.h
index cacde80..29ceafe 100644 ===================================================================
--- a/include/libiberty.h --- nvptx-tools.orig/include/libiberty.h 2016-03-10 14:11:40.000000000 +0100
+++ b/include/libiberty.h +++ nvptx-tools/include/libiberty.h 2017-09-05 09:01:13.252598031 +0200
@@ -390,6 +390,17 @@ extern void hex_init (void); @@ -390,6 +390,17 @@ extern void hex_init (void);
/* Save files used for communication between processes. */ /* Save files used for communication between processes. */
#define PEX_SAVE_TEMPS 0x4 #define PEX_SAVE_TEMPS 0x4
@ -32,10 +33,10 @@ index cacde80..29ceafe 100644
/* Prepare to execute one or more programs, with standard output of /* Prepare to execute one or more programs, with standard output of
each program fed to standard input of the next. each program fed to standard input of the next.
FLAGS As above. FLAGS As above.
diff --git a/nvptx-as.c b/nvptx-as.c Index: nvptx-tools/nvptx-as.c
index 53331af..1ad6699 100644 ===================================================================
--- a/nvptx-as.c --- nvptx-tools.orig/nvptx-as.c 2016-03-10 14:11:40.000000000 +0100
+++ b/nvptx-as.c +++ nvptx-tools/nvptx-as.c 2017-09-05 09:01:13.252598031 +0200
@@ -30,6 +30,9 @@ @@ -30,6 +30,9 @@
#include <string.h> #include <string.h>
#include <wait.h> #include <wait.h>
@ -113,7 +114,7 @@ index 53331af..1ad6699 100644
do do
tok = parse_file (tok); tok = parse_file (tok);
while (tok->kind); while (tok->kind);
@@ -897,9 +944,83 @@ fork_execute (const char *prog, char *const *argv) @@ -897,9 +944,83 @@ fork_execute (const char *prog, char *co
do_wait (prog, pex); do_wait (prog, pex);
} }
@ -217,7 +218,7 @@ index 53331af..1ad6699 100644
break; break;
case 'v': case 'v':
verbose = true; verbose = true;
@@ -948,7 +1071,9 @@ Usage: nvptx-none-as [option...] [asmfile]\n\ @@ -948,7 +1071,9 @@ Usage: nvptx-none-as [option...] [asmfil
Options:\n\ Options:\n\
-o FILE Write output to FILE\n\ -o FILE Write output to FILE\n\
-v Be verbose\n\ -v Be verbose\n\
@ -227,7 +228,7 @@ index 53331af..1ad6699 100644
--help Print this help and exit\n\ --help Print this help and exit\n\
--version Print version number and exit\n\ --version Print version number and exit\n\
\n\ \n\
@@ -983,11 +1108,17 @@ This program has absolutely no warranty.\n", @@ -983,11 +1108,17 @@ This program has absolutely no warranty.
if (!in) if (!in)
fatal_error ("cannot open input ptx file"); fatal_error ("cannot open input ptx file");
@ -248,10 +249,10 @@ index 53331af..1ad6699 100644
{ {
struct obstack argv_obstack; struct obstack argv_obstack;
obstack_init (&argv_obstack); obstack_init (&argv_obstack);
diff --git a/configure b/configure Index: nvptx-tools/configure
index 9a0794a..4289569 100755 ===================================================================
--- a/configure --- nvptx-tools.orig/configure 2016-03-10 14:11:40.000000000 +0100
+++ b/configure +++ nvptx-tools/configure 2017-09-05 09:01:57.637325605 +0200
@@ -168,7 +168,8 @@ test x\$exitcode = x0 || exit 1" @@ -168,7 +168,8 @@ test x\$exitcode = x0 || exit 1"
as_suggested=" as_lineno_1=";as_suggested=$as_suggested$LINENO;as_suggested=$as_suggested" as_lineno_1a=\$LINENO as_suggested=" as_lineno_1=";as_suggested=$as_suggested$LINENO;as_suggested=$as_suggested" as_lineno_1a=\$LINENO
as_lineno_2=";as_suggested=$as_suggested$LINENO;as_suggested=$as_suggested" as_lineno_2a=\$LINENO as_lineno_2=";as_suggested=$as_suggested$LINENO;as_suggested=$as_suggested" as_lineno_2a=\$LINENO
@ -535,7 +536,7 @@ index 9a0794a..4289569 100755
cat >config.log <<_ACEOF cat >config.log <<_ACEOF
This file contains any messages produced by compilers while This file contains any messages produced by compilers while
running configure, to aid debugging if configure makes a mistake. running configure, to aid debugging if configure makes a mistake.
@@ -3284,6 +3523,418 @@ cat >>confdefs.h <<_ACEOF @@ -3284,6 +3523,430 @@ cat >>confdefs.h <<_ACEOF
#define HAVE_DECL_CUGETERRORSTRING $ac_have_decl #define HAVE_DECL_CUGETERRORSTRING $ac_have_decl
_ACEOF _ACEOF
@ -950,6 +951,18 @@ index 9a0794a..4289569 100755
+fi +fi
+ +
+done +done
+
+ac_fn_c_check_decl "$LINENO" "getopt" "ac_cv_have_decl_getopt" "#include <unistd.h>
+"
+if test "x$ac_cv_have_decl_getopt" = x""yes; then :
+ ac_have_decl=1
+else
+ ac_have_decl=0
+fi
+
+cat >>confdefs.h <<_ACEOF
+#define HAVE_DECL_GETOPT $ac_have_decl
+_ACEOF
+ +
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for extra programs to build requiring -lcuda" >&5 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for extra programs to build requiring -lcuda" >&5

View File

@ -1,7 +1,7 @@
# #
# spec file for package nvptx-tools # spec file for package nvptx-tools
# #
# Copyright (c) 2016 SUSE LINUX GmbH, Nuernberg, Germany. # Copyright (c) 2017 SUSE LINUX GmbH, Nuernberg, Germany.
# #
# All modifications and additions to the file contributed by third parties # All modifications and additions to the file contributed by third parties
# remain the property of their copyright owners, unless otherwise agreed # remain the property of their copyright owners, unless otherwise agreed
@ -25,14 +25,14 @@ Group: Development/Tools/Building
Url: https://github.com/MentorEmbedded/nvptx-tools/ Url: https://github.com/MentorEmbedded/nvptx-tools/
# tarball built from https://github.com/MentorEmbedded/nvptx-tools.git # tarball built from https://github.com/MentorEmbedded/nvptx-tools.git
Source0: nvptx-tools.tar.xz Source0: nvptx-tools.tar.xz
Patch: nvptx-tools.patch Patch: nvptx-tools.patch
BuildRoot: %{_tmppath}/%{name}-%{version}-build BuildRoot: %{_tmppath}/%{name}-%{version}-build
# Note that w/o a CUDA development (at least cuda.h and libcuda.so) the # Note that w/o a CUDA development (at least cuda.h and libcuda.so) the
# tools for executing are not built. CUDA is not free software. # tools for executing are not built. CUDA is not free software.
BuildRequires: gcc-c++ BuildRequires: gcc-c++
# The package is used for NVPTX offloading support in GCC which is currently # The package is used for NVPTX offloading support in GCC which is currently
# only enabled on x86_64 # only enabled on x86_64
ExclusiveArch: x86_64 ExclusiveArch: x86_64
%description %description
A collection of tools for use with nvptx-none (NVIDIA Parallel Thread A collection of tools for use with nvptx-none (NVIDIA Parallel Thread