-
Notifications
You must be signed in to change notification settings - Fork 5
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
add coremark port #76
Merged
Merged
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
diff --git a/posix/core_portme.mak b/posix/core_portme.mak | ||
index 2852069..3eaaabe 100755 | ||
--- a/posix/core_portme.mak | ||
+++ b/posix/core_portme.mak | ||
@@ -24,8 +24,12 @@ OUTFLAG= -o | ||
CC?= cc | ||
# Flag: CFLAGS | ||
# Use this flag to define compiler options. Note, you can add compiler options from the command line using XCFLAGS="other flags" | ||
-PORT_CFLAGS = -O2 | ||
-FLAGS_STR = "$(PORT_CFLAGS) $(XCFLAGS) $(XLFLAGS) $(LFLAGS_END)" | ||
+PORT_CFLAGS = | ||
+FLAGS_STR := $(filter-out -I%,$(PORT_CFLAGS) $(XCFLAGS) $(XLFLAGS) $(LFLAGS_END)) | ||
+FLAGS_STR := $(filter-out --sysroot=%,$(FLAGS_STR)) | ||
+FLAGS_STR := $(filter-out -B%,$(FLAGS_STR)) | ||
+FLAGS_STR := $(filter-out -L%,$(FLAGS_STR)) | ||
+FLAGS_STR := "$(filter-out -fmacro-prefix-map=%,$(FLAGS_STR))" | ||
nalajcie marked this conversation as resolved.
Show resolved
Hide resolved
|
||
CFLAGS = $(PORT_CFLAGS) -I$(PORT_DIR) -Iposix -I. -DFLAGS_STR=\"$(FLAGS_STR)\" | ||
# Flag: NO_LIBRT | ||
# Define if the platform does not provide a librt | ||
@@ -65,7 +69,7 @@ LOAD = echo Loading done | ||
RUN = | ||
|
||
OEXT = .o | ||
-EXE = .exe | ||
+EXE = | ||
|
||
# Flag: SEPARATE_COMPILE | ||
# Define if you need to separate compilation from link stage. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,64 @@ | ||
#!/usr/bin/env bash | ||
|
||
set -e | ||
|
||
COREMARK_VER="1.0" | ||
COREMARK=coremark-${COREMARK_VER} | ||
COREMARK_COMMIT="d5fad6bd094899101a4e5fd53af7298160ced6ab" | ||
PKG_URL="https://github.com/eembc/coremark/archive/${COREMARK_COMMIT}.tar.gz" | ||
PKG_MIRROR_URL="https://files.phoesys.com/ports/${COREMARK}.tar.gz" | ||
|
||
b_log "Building coremark" | ||
PREFIX_COREMARK="${PREFIX_PROJECT}/phoenix-rtos-ports/coremark" | ||
PREFIX_COREMARK_BUILD="${PREFIX_BUILD}/coremark" | ||
PREFIX_COREMARK_SRC="${PREFIX_COREMARK_BUILD}/${COREMARK}" | ||
PREFIX_COREMARK_MARKERS="${PREFIX_COREMARK_BUILD}/markers" | ||
|
||
# | ||
# Download and unpack | ||
# | ||
mkdir -p "$PREFIX_COREMARK_BUILD" | ||
if ! [ -f "${PREFIX_COREMARK}/${COREMARK}.tar.gz" ]; then | ||
if ! wget "$PKG_URL" -O "${PREFIX_COREMARK}/${COREMARK}.tar.gz" --no-check-certificate; then | ||
wget "$PKG_MIRROR_URL" -P "${PREFIX_COREMARK}" --no-check-certificate | ||
fi | ||
fi | ||
|
||
if ! [ -d "${PREFIX_COREMARK_SRC}" ]; then | ||
tar xzf "${PREFIX_COREMARK}/${COREMARK}.tar.gz" -C "${PREFIX_COREMARK_BUILD}" && mv "${PREFIX_COREMARK_BUILD}"/coremark-"${COREMARK_COMMIT}" "${PREFIX_COREMARK_BUILD}"/${COREMARK} | ||
fi | ||
|
||
# | ||
# Apply patches | ||
# | ||
mkdir -p "$PREFIX_COREMARK_MARKERS" | ||
|
||
for patchfile in "$PREFIX_COREMARK"/*.patch; do | ||
if [ ! -f "$PREFIX_COREMARK_BUILD/markers/$(basename "$patchfile").applied" ]; then | ||
echo "applying patch: $patchfile" | ||
patch -d "$PREFIX_COREMARK_SRC" -p1 < "$patchfile" | ||
touch "$PREFIX_COREMARK_MARKERS/$(basename "$patchfile").applied" | ||
fi | ||
done | ||
|
||
# | ||
# Configure | ||
# | ||
mkdir -p "${PREFIX_COREMARK_BUILD}/${COREMARK}/phoenix" | ||
cp -a "$PREFIX_COREMARK/core-portme.mak" "$PREFIX_COREMARK_BUILD/${COREMARK}/phoenix/core_portme.mak" | ||
|
||
cd "${PREFIX_COREMARK_BUILD}/${COREMARK}" | ||
|
||
if [ -z ${PORTS_COREMARK_THREADS+x} ]; then | ||
PORTS_COREMARK_THREADS="1" | ||
fi | ||
|
||
export XCFLAGS="${CFLAGS} -DUSE_PTHREAD -DMULTITHREAD=${PORTS_COREMARK_THREADS}" | ||
lukileczo marked this conversation as resolved.
Show resolved
Hide resolved
|
||
export XLFLAGS="${LDFLAGS}" | ||
|
||
# Build coremark | ||
PORT_DIR=phoenix make compile | ||
|
||
cp -a "$PREFIX_COREMARK_BUILD/${COREMARK}/coremark" "$PREFIX_PROG/coremark" | ||
"${CROSS}strip" -s "${PREFIX_PROG}/coremark" -o "${PREFIX_PROG_STRIPPED}/coremark" | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. invalid stripping for NOMMU (removing relocations). Either write that nommu is not supported or do it properly. |
||
b_install "$PREFIX_PORTS_INSTALL/coremark" /bin |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
NO_LIBRT = 1 | ||
|
||
include posix/core_portme.mak |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
uh, removing the
--sysroot
makes the port build againstlibphoenix
embedded in toolchain, not in project - so IMHO not intended? Also-B
is needed for selection correctcrt0.o
(project against toolchain) if I remember correctlyThere was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is only for the
FLAGS_STR
define (which prints out in coremark)I removed the flags from the string so that we don't get wall of flags not affecting performance of the benchmark (and only leave the important ones).
The application is built with all the flags defined.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
see https://github.com/phoenix-rtos/phoenix-rtos-build/blob/master/makes/setup-sysroot.mk#L20 for detailed breakdown of how sysroot options are used.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hmm I don't think we understand each other :)
FLAGS_STR
is only provided to preprocessor define (https://github.com/eembc/coremark/blob/d5fad6bd094899101a4e5fd53af7298160ced6ab/posix/core_portme.mak#L29). Here's what actual build uses: https://github.com/eembc/coremark/blob/d5fad6bd094899101a4e5fd53af7298160ced6ab/Makefile#L87Only I've now realized that
XLFLAGS
are not passed correctly, will fix that.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
sorry, when I was posting my reply, I haven't yet see your reply (it was just an update over original comment).
I was mislead by the original comment above (that it's being used for compilation) and the patch doesn't have the variable usage. Maybe small comment regarding why you're removing it / it's safe to do so would prevent any confusion in the future ;)