4 # Copyright(c) 2015 Neil Horman. All rights reserved.
7 # Redistribution and use in source and binary forms, with or without
8 # modification, are permitted provided that the following conditions
11 # * Redistributions of source code must retain the above copyright
12 # notice, this list of conditions and the following disclaimer.
13 # * Redistributions in binary form must reproduce the above copyright
14 # notice, this list of conditions and the following disclaimer in
15 # the documentation and/or other materials provided with the
18 # THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
19 # "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
20 # LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
21 # A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
22 # OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
23 # SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
24 # LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
25 # DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
26 # THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
27 # (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
28 # OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
33 ABI_DIR=`mktemp -d -p /tmp ABI.XXXXXX`
36 echo "$0 <TAG1> <TAG2> <TARGET>"
46 git tag -l | grep -q "$TAG1"
49 echo "$TAG1 is invalid"
52 git tag -l | grep -q "$TAG2"
55 echo "$TAG2 is invalid"
63 echo "Must Specify TAG1"
68 echo "Must Specify TAG2"
73 echo "Must Specify a build target"
80 git checkout $CURRENT_BRANCH
84 ###########################################
86 ############################################
88 #trap on ctrl-c to clean up
89 trap cleanup_and_exit SIGINT
91 #Save the current branch
92 CURRENT_BRANCH=`git branch | grep \* | cut -d' ' -f2`
94 if [ -z "$CURRENT_BRANCH" ]
96 CURRENT_BRANCH=`git log --pretty=format:%H HEAD~1..HEAD`
101 export VERBOSE=/dev/stdout
103 export VERBOSE=/dev/null
106 # Validate that we have all the arguments we need
115 # Make sure our tags exist
123 ABICHECK=`which abi-compliance-checker 2>/dev/null`
126 log "INFO" "Cant find abi-compliance-checker utility"
130 ABIDUMP=`which abi-dumper 2>/dev/null`
133 log "INFO" "Cant find abi-dumper utility"
137 log "INFO" "We're going to check and make sure that applications built"
138 log "INFO" "against DPDK DSOs from tag $TAG1 will still run when executed"
139 log "INFO" "against DPDK DSOs built from tag $TAG2."
142 # Check to make sure we have a clean tree
143 git status | grep -q clean
146 log "WARN" "Working directory not clean, aborting"
150 # Move to the root of the git tree
153 log "INFO" "Checking out version $TAG1 of the dpdk"
154 # Move to the old version of the tree
157 # Make sure we configure SHARED libraries
158 # Also turn off IGB and KNI as those require kernel headers to build
159 sed -i -e"$ a\CONFIG_RTE_BUILD_SHARED_LIB=y" config/defconfig_$TARGET
160 sed -i -e"$ a\CONFIG_RTE_NEXT_ABI=n" config/defconfig_$TARGET
161 sed -i -e"$ a\CONFIG_RTE_EAL_IGB_UIO=n" config/defconfig_$TARGET
162 sed -i -e"$ a\CONFIG_RTE_LIBRTE_KNI=n" config/defconfig_$TARGET
164 # Checking abi compliance relies on using the dwarf information in
165 # The shared objects. Thats only included in the DSO's if we build
167 export EXTRA_CFLAGS=-g
168 export EXTRA_LDFLAGS=-g
170 # Now configure the build
171 log "INFO" "Configuring DPDK $TAG1"
172 make config T=$TARGET O=$TARGET > $VERBOSE 2>&1
174 log "INFO" "Building DPDK $TAG1. This might take a moment"
175 make O=$TARGET > $VERBOSE 2>&1
179 log "INFO" "THE BUILD FAILED. ABORTING"
183 # Move to the lib directory
185 log "INFO" "COLLECTING ABI INFORMATION FOR $TAG1"
188 $ABIDUMP $i -o $ABI_DIR/$i-ABI-0.dump -lver $TAG1
192 # Now clean the tree, checkout the second tag, and rebuild
195 # Move to the new version of the tree
196 log "INFO" "Checking out version $TAG2 of the dpdk"
199 # Make sure we configure SHARED libraries
200 # Also turn off IGB and KNI as those require kernel headers to build
201 sed -i -e"$ a\CONFIG_RTE_BUILD_SHARED_LIB=y" config/defconfig_$TARGET
202 sed -i -e"$ a\CONFIG_RTE_NEXT_ABI=n" config/defconfig_$TARGET
203 sed -i -e"$ a\CONFIG_RTE_EAL_IGB_UIO=n" config/defconfig_$TARGET
204 sed -i -e"$ a\CONFIG_RTE_LIBRTE_KNI=n" config/defconfig_$TARGET
206 # Now configure the build
207 log "INFO" "Configuring DPDK $TAG2"
208 make config T=$TARGET O=$TARGET > $VERBOSE 2>&1
210 log "INFO" "Building DPDK $TAG2. This might take a moment"
211 make O=$TARGET > $VERBOSE 2>&1
215 log "INFO" "THE BUILD FAILED. ABORTING"
220 log "INFO" "COLLECTING ABI INFORMATION FOR $TAG2"
223 $ABIDUMP $i -o $ABI_DIR/$i-ABI-1.dump -lver $TAG2
227 # Start comparison of ABI dumps
228 for i in `ls $ABI_DIR/*-1.dump`
230 NEWNAME=`basename $i`
231 OLDNAME=`basename $i | sed -e"s/1.dump/0.dump/"`
232 LIBNAME=`basename $i | sed -e"s/-ABI-1.dump//"`
234 if [ ! -f $ABI_DIR/$OLDNAME ]
236 log "INFO" "$OLDNAME DOES NOT EXIST IN $TAG1. SKIPPING..."
239 #compare the abi dumps
240 $ABICHECK -l $LIBNAME -old $ABI_DIR/$OLDNAME -new $ABI_DIR/$NEWNAME
244 log "INFO" "ABI CHECK COMPLETE. REPORTS ARE IN compat_report directory"