Skip to content

Commit

Permalink
Fix SunCC 12.2 failed compile due to -D__AES__ and above platform fla…
Browse files Browse the repository at this point in the history
…gs (Issue 228)
  • Loading branch information
noloader committed Jul 15, 2016
1 parent aae1f27 commit fa758db
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions cryptest.sh
Expand Up @@ -2675,6 +2675,9 @@ if [[ "$IS_SOLARIS" -ne "0" ]]; then
# Sun Studio 12.2
if [[ (-e "/opt/solstudio12.2/bin/CC") ]]; then

# Sun Studio 12.2 and below workaround, http://github.com/weidai11/cryptopp/issues/228
SUNCC_122_CXXFLAGS=$(echo "$SUNCC_CXXFLAGS" | "$AWK" '/SSE/' ORS=' ' RS=' ')

############################################
# Debug build
echo
Expand All @@ -2685,7 +2688,7 @@ if [[ "$IS_SOLARIS" -ne "0" ]]; then
"$MAKE" clean > /dev/null 2>&1
rm -f adhoc.cpp > /dev/null 2>&1

CXXFLAGS="-DDEBUG -g -xO0 $SUNCC_CXXFLAGS"
CXXFLAGS="-DDEBUG -g -xO0 $SUNCC_122_CXXFLAGS"
CXX=/opt/solstudio12.2/bin/CC CXXFLAGS="$CXXFLAGS" "$MAKE" "${MAKEARGS[@]}" static dynamic cryptest.exe 2>&1 | tee -a "$TEST_RESULTS"

if [[ ("${PIPESTATUS[0]}" -ne "0") ]]; then
Expand All @@ -2711,7 +2714,7 @@ if [[ "$IS_SOLARIS" -ne "0" ]]; then
"$MAKE" clean > /dev/null 2>&1
rm -f adhoc.cpp > /dev/null 2>&1

CXXFLAGS="-DNDEBUG -g0 -xO2 $SUNCC_CXXFLAGS"
CXXFLAGS="-DNDEBUG -g0 -xO2 $SUNCC_122_CXXFLAGS"
CXX=/opt/solstudio12.2/bin/CC CXXFLAGS="$CXXFLAGS" "$MAKE" "${MAKEARGS[@]}" static dynamic cryptest.exe 2>&1 | tee -a "$TEST_RESULTS"

if [[ ("${PIPESTATUS[0]}" -ne "0") ]]; then
Expand Down

1 comment on commit fa758db

@noloader
Copy link
Collaborator Author

@noloader noloader commented on fa758db Jul 15, 2016

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Also see Issue 228: SunCC 12.2 and failed compile using Platform CXXFLAGS.

Thanks to John on Unix & Linux Stack Exchange for the AWK to filter the higher defines which caused problems for SunCC 12.2:

SUNCC_122_CXXFLAGS=$(echo "$SUNCC_CXXFLAGS" | "$AWK" '/SSE/' ORS=' ' RS=' ')

Please sign in to comment.