incubator-stdcxx-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Martin Sebor <se...@roguewave.com>
Subject Re: [PATCH] Library path fix
Date Wed, 29 Nov 2006 18:02:32 GMT
Andrew Black wrote:
> Greetings all.
> 
> After checking in this patch, I was performing a test build on AIX 5.2 
> with GCC, and discovered that the version of ld available with this OS 
> doesn't support the -bsrv4 and -R switches.  Attached is a patch that 
> aims to resolve this issue, along with a related issue with vacpp on 
> Linux (-bsrv4 is an AIX specific switch).

Please prefer the := form of variable assignment when possible in
order to have the expression on the right hand side evaluated just
once rather than each time the variable is expanded.

Before committing please also adjust the length of your ChangeLog
lines to less than 80 characters.

Thanks
Martin

> 
> --Andrew Black
> 
> Changelog:
>     * gcc.config [AIX] (OS_MAJOR, OS_MINOR): Retrieve and store OS major 
> and minor version.
>     [AIX] (SHARED_CPPFLAGS): Only set if OS is 5.3 or newer (Earlier 
> versions of ld don't support -bsrv4, -R switches).
>     * vacpp.config [AIX] (OS_MAJOR, OS_MINOR): Retrieve and store OS 
> major and minor version.
>     [AIX] (SHARED_CPPFLAGS): Only set if OS is 5.3 or newer (Earlier 
> versions of ld don't support -bsrv4, -R switches).
>     [!AIX] (SHARED_CPPFLAGS): Use -R switch (assuming Linux ld).
> 
> 
> ------------------------------------------------------------------------
> 
> Index: etc/config/gcc.config
> ===================================================================
> --- etc/config/gcc.config	(revision 480289)
> +++ etc/config/gcc.config	(working copy)
> @@ -12,6 +12,12 @@
>  CXX_MAJOR      := $(shell echo "$(CCVER)" | sed "s/^\([1-9][0-9]*\).*/\1/")
>  CXX_MINOR      := $(shell echo "$(CCVER)" | sed "s/[1-9]*\.\([0-9]*\).*/\1/")
>  
> +# determine the major and minor version of the OS on AIX
> +ifeq ($(OSNAME),AIX)
> +    OS_MAJOR = $(shell uname -v)
> +    OS_MINOR = $(shell uname -r)
> +endif
> +
>  # -W and -Wextra are the same
>  WARNFLAGS       = -W -Wall -Wcast-qual -Winline -Wshadow -Wwrite-strings
>  
> @@ -139,7 +145,10 @@
>      SHARED_LDFLAGS = -Wl,-R$(LIBDIR)
>    else
>      ifeq ($(OSNAME),AIX)
> -      SHARED_LDFLAGS = -Wl,-bsvr4,-R$(LIBDIR)
> +      ifeq ($(shell expr $(OS_MAJOR) \< 5 \| $(OS_MINOR) \< 3),0)
> +        # -bsrv4, -R only available on AIX 5.3 and newer
> +        SHARED_LDFLAGS  = -Wl,-bsvr4,-R$(LIBDIR)
> +      endif
>      else
>        ifeq ($(OSNAME),HP-UX)
>          SHARED_LDFLAGS = -Wl,+b$(LIBDIR)
> Index: etc/config/vacpp.config
> ===================================================================
> --- etc/config/vacpp.config	(revision 480289)
> +++ etc/config/vacpp.config	(working copy)
> @@ -41,6 +41,12 @@
>  CXX_MAJOR       = $(shell echo "$(CCVER)" | sed "s/^\([1-9][0-9]*\).*/\1/")
>  CXX_MINOR       = $(shell echo "$(CCVER)" | sed "s/[1-9]*\.\([0-9]*\).*/\1/")
>  
> +# determine the major and minor version of the OS on AIX
> +ifeq ($(OSNAME),AIX)
> +    OS_MAJOR = $(shell uname -v)
> +    OS_MINOR = $(shell uname -r)
> +endif
> +
>  # suppress bogus warnings:
>  # 1540-0152: A template dependent name that is a type must be qualified
>  #            with "typename".
> @@ -111,7 +117,14 @@
>  # shared/archive library options
>  SHARED_CXXFLAGS = 
>  SHARED_CPPFLAGS =
> -SHARED_LDFLAGS  = -Wl,-bsvr4,-R$(LIBDIR)
> +ifeq ($(OSNAME),AIX)
> +  ifeq ($(shell expr $(OS_MAJOR) \< 5 \| $(OS_MINOR) \< 3),0)
> +    # -bsrv4, -R only available on AIX 5.3 and newer
> +    SHARED_LDFLAGS  = -Wl,-bsvr4,-R$(LIBDIR)
> +  endif
> +else   # assume Linux
> +  SHARED_LDFLAGS  = -Wl,-R$(LIBDIR)
> +endif
>  
>  ifeq ($(rtl_enabled),1)
>    SHARED_SUFFIX = .so


Mime
View raw message