United StatesChange Country, Oracle Worldwide Web Sites Communities I am a... I want to...
JDK-8006808 : mapfile use check in jdk/make/common/shared/Defs-solaris.gmk is throwing 'egrep: syntax error'

Details
Type:
Bug
Submit Date:
2013-01-24
Status:
Resolved
Updated Date:
2013-02-08
Project Name:
JDK
Resolved Date:
2013-02-01
Component:
infrastructure
OS:
solaris
Sub-Component:
build
CPU:
x86
Priority:
P3
Resolution:
Fixed
Affected Versions:
Fixed Versions:

Related Reports
Relates:

Sub Tasks

Description
Evaluating the 'if [...]' line in the code snippet below seems to be throwing an error, on Solaris at least:

cat -n jdk/make/common/shared/Defs-solaris.gmk


   217  # Macro to check it's input file for banned dependencies and verify the
   218  #   binary built properly. Relies on process exit code.
   219  ifndef CROSS_COMPILE_ARCH
   220  define binary_file_verification # binary_file
   221  ( \
   222    $(ECHO) "Checking for mapfile use in: $1" && \
   223    if [ "`$(ECHO) $(basename $(notdir $1)) | $(EGREP) '$(MAPFILE_EXCEPTIONS)'`" = "" \
   224         -a "`$(NM) -g -D $1 | $(EGREP) -v 'UNDEF' | $(EGREP) 'SUNWprivate'`" = "" ] ; then \
   225      $(ECHO) "$(MAPFILE_WARNING): File was not built with a mapfile: $1"; \
   226    fi && \
   227    $(ECHO) "Library loads for: $1" && \
   228    $(LDD) $1 && \
   229    $(ECHO) "RUNPATH for: $1" && \
   230    ( $(DUMP) -L -v $1 | $(EGREP) 'NEEDED|RUNPATH|RPATH' ) \
   231  )


Examples I noticed in the build log:


Checking for mapfile use in: ../../../build/solaris-amd64/lib/amd64/server/libjvm.so
egrep: syntax error

[...]

Checking for mapfile use in: ../../build/solaris-amd64/bin/amd64/keytool
egrep: syntax error

[...]



Refer to the attached build log for more.

                                    

Comments
ifeq ($(ARCH_FAMILY),sparc)
  MAPFILE_EXCEPTIONS = \
    (libjdgaSUNWafb|libjdgaSUNWcg6|libjdgaSUNWffb|libjdgaSUNWm64|libxinerama)
else
  MAPFILE_EXCEPTIONS = ()
endif

On x86/64 you end up doing "egrep '()' - which gives the error
                                     
2013-01-24
See David's comment.  The () causes egrep to throw "egrep: syntax error"

                                     
2013-02-01
URL:   http://hg.openjdk.java.net/jdk8/build/jdk/rev/35cf77f633c9
User:  tbell
Date:  2013-02-01 17:18:32 +0000

                                     
2013-02-01
URL:   http://hg.openjdk.java.net/jdk8/jdk8/jdk/rev/35cf77f633c9
User:  katleman
Date:  2013-02-07 01:10:46 +0000

                                     
2013-02-07



Hardware and Software, Engineered to Work Together