hc
2023-05-26 a23f51ed7a39e452c1037343a84d7db1ca2c5bd7
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
From: Marek Vasut <marex@denx.de>
Subject: [PATCH 07/12] libtool: Fix support for NIOS2 processor
 
The name of the system contains the string "nios2". This string
is caught by the some of the greedy checks for OS/2 in libtool,
in particular the *os2* branches of switch statements match for
the nios2 string, which results in incorrect behavior of libtool.
 
This patch adds an explicit check for *nios2* before the *os2*
checks to prevent the OS/2 check incorrectly trapping the nios2
as well.
 
Signed-off-by: Marek Vasut <marex@denx.de>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
 
Upstream-Status: Submitted [https://lists.gnu.org/archive/html/libtool-patches/2021-10/msg00021.html]
 
---
 build-aux/ltmain.in | 20 ++++++++++++++++++++
 1 file changed, 20 insertions(+)
 
diff --git a/build-aux/ltmain.in b/build-aux/ltmain.in
index d5cf07a..4164284 100644
--- a/build-aux/ltmain.in
+++ b/build-aux/ltmain.in
@@ -504,6 +504,12 @@ libtool_validate_options ()
     test : = "$debug_cmd" || func_append preserve_args " --debug"
 
     case $host in
+      # For NIOS2, we want to make sure that it's not caught by the
+      # more general OS/2 check below. Otherwise, NIOS2 is the same
+      # as the default option.
+      *nios2*)
+        opt_duplicate_compiler_generated_deps=$opt_preserve_dup_deps
+        ;;
       # Solaris2 added to fix http://debbugs.gnu.org/cgi/bugreport.cgi?bug=16452
       # see also: http://gcc.gnu.org/bugzilla/show_bug.cgi?id=59788
       *cygwin* | *mingw* | *pw32* | *cegcc* | *solaris2* | *os2*)
@@ -6220,6 +6226,15 @@ func_mode_link ()
     if test -n "$library_names" &&
        { test no = "$use_static_libs" || test -z "$old_library"; }; then
       case $host in
+      *nios2*)
+        # For NIOS2, we want to make sure that it's not caught by the
+        # more general OS/2 check below. Otherwise, NIOS2 is the same
+        # as the default option.
+        if test no = "$installed"; then
+          func_append notinst_deplibs " $lib"
+          need_relink=yes
+        fi
+        ;;
       *cygwin* | *mingw* | *cegcc* | *os2*)
           # No point in relinking DLLs because paths are not encoded
           func_append notinst_deplibs " $lib"
@@ -6290,6 +6305,11 @@ func_mode_link ()
         elif test -n "$soname_spec"; then
           # bleh windows
           case $host in
+          *nios2*)
+        # For NIOS2, we want to make sure that it's not caught by the
+        # more general OS/2 check below. Otherwise, NIOS2 is the same
+        # as the default option.
+        ;;
           *cygwin* | mingw* | *cegcc* | *os2*)
             func_arith $current - $age
         major=$func_arith_result
-- 
2.5.1