Opened 8 years ago

Closed 8 years ago

#1558 closed defect (fixed)

configure.ac check for rpath -R flag

Reported by: jreed Owned by: jelte
Priority: medium Milestone: Sprint-20120124
Component: build system Version:
Keywords: Cc:
CVSS Scoring: Parent Tickets:
Sensitive: no Defect Severity: N/A
Sub-Project: Core Feature Depending on Ticket:
Estimated Difficulty: 0 Add Hours to Ticket: 0
Total Hours: 0 Internal?: no

Description (last modified by jreed)

configure.ac has wrong code for checking if linker accepts -R flag. It assumes that the compiler has it, but
g++ 4.6.2 on haikuo's system doesn't support it. It is a linker switch not a compiler switch.

The existing autoconf code is:

# check -R rather than gcc specific -rpath to be as portable as possible.
AC_MSG_CHECKING([whether -R flag is available in linker])
LDFLAGS_SAVED="$LDFLAGS"
LDFLAGS="$LDFLAGS -R/usr/lib"
AC_TRY_LINK([],[],
        [ AC_MSG_RESULT(yes)
                rpath_available=yes
        ],[ AC_MSG_RESULT(no)
        rpath_available=no
        ])
LDFLAGS=$LDFLAGS_SAVED

Proper way for gcc is -Wl,-R, but SunStudio? doesn't have that.

The problem is that rpath_available=no causes -R not to be set so -R is not added and can't find dependency libraries in custom locations (as see on Haikuo's system).

Subtickets

Change History (7)

comment:1 Changed 8 years ago by jelte

  • Milestone changed from New Tasks to Sprint-20120124

comment:2 Changed 8 years ago by jreed

  • Description modified (diff)

comment:3 Changed 8 years ago by jelte

  • Owner changed from UnAssigned to jelte
  • Status changed from new to assigned

comment:4 Changed 8 years ago by jelte

  • Owner changed from jelte to haikuo

I've added a check and flag replacement. Haikuo, since you reported this problem, could you check if the version in branch trac1558 works for you? (assigning this ticket directly to you)

comment:5 Changed 8 years ago by jelte

  • Owner changed from haikuo to UnAssigned
  • Status changed from assigned to reviewing

comment:6 Changed 8 years ago by vorner

  • Owner changed from UnAssigned to jelte

Hello

I'm looking at the diff. I agree that if the problem really is missing -R in the compiler, this should solve it. But I don't have the right compiler to check, so someone who does might want to verify it really does fix the problem.

Other than that, I found only one minor thing, indentation:

+            [ AC_MSG_RESULT(yes)
+                rpath_flag=-Wl,-R
+            ],[ AC_MSG_RESULT(no)
+                 rpath_flag=no
+            ])

comment:7 Changed 8 years ago by jelte

  • Resolution set to fixed
  • Status changed from reviewing to closed

I'm gonna propose to do a one-time fix for all indentation in configure.ac, it's a mess. As such, I'm merging and closing this now :)

Note: See TracTickets for help on using tickets.