Skip to content

Commit

Permalink
fix the march situation and bug introduced in shared libgerbil buildi…
Browse files Browse the repository at this point in the history
…ng (#792)

* fix the --enable-march situation

there is a gambit configure bug related to this and on the same time
not specifying it is discourage; so we do native by default.

* fix unbound variable

* add --enable-shared build on CI matrix
  • Loading branch information
vyzo authored Sep 5, 2023
1 parent d72a39d commit d70df51
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 3 deletions.
3 changes: 2 additions & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,12 +7,13 @@ jobs:
fail-fast: false # if one fails, do not cancel the other
matrix:
gambit-version: ['v4.9.5', 'master']
shared-mode: ['', '--enable-shared']
steps:
- uses: actions/checkout@v2
- name: Install dependencies
run: sudo apt-get -y install openssl libssl-dev sqlite3 libsqlite3-dev
- name: Configure Gerbil
run: ./configure --prefix=/opt/gerbil --with-gambit=${{ matrix.gambit-version }}
run: ./configure --prefix=/opt/gerbil --with-gambit=${{ matrix.gambit-version }} ${{ matrix.shared-mode }}
- name: Create Gerbil version file
run: echo "(define (gerbil-version-string) \"git-$(git rev-parse --short=8 HEAD)\")" > src/gerbil/runtime/gx-version.scm
- name: Prepare Build
Expand Down
10 changes: 9 additions & 1 deletion configure
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,8 @@ Options understood and processed by Gerbil:
--prefix=PREFIX where to install Gerbil; default prefix is /opt/gerbil
--with-gambit=TAG integrated gambit git tag to check out for the build;
defaults to ${default_gambit_tag}
--enable-march=ARCH specify the machine architecture; it can be empty.
defaults to native
Gerbil Standard Library features:
--enable-libxml Enable or disable libxml based libraries; disabled by default
Expand Down Expand Up @@ -63,6 +65,7 @@ prefix="/opt/gerbil"
readonly cflags_opt="-foptimize-sibling-calls"
readonly ldflags_rpath="-Wl,-rpath"

gambit_march="native"
gambit_tag="${default_gambit_tag}"
gambit_config="${default_gambit_config}"

Expand All @@ -83,6 +86,11 @@ while [ $# -gt 0 ]; do
shift
;;

--enable-march=*)
gambit_march=$(echo "$1" | cut -d = -f 2-)
shift
;;

--enable-libxml)
std_enable_feature libxml
shift
Expand Down Expand Up @@ -198,7 +206,7 @@ git submodule update --force || die

(cd src/gambit && git pull origin master && git checkout "${gambit_tag}" && touch configure config.status) || die

gambit_config="--prefix=${gerbil_prefix} ${gambit_config} LDFLAGS=${LDFLAGS} CFLAGS=${CFLAGS}"
gambit_config="--prefix=${gerbil_prefix} --enable-march=${gambit_march} ${gambit_config} LDFLAGS=${LDFLAGS} CFLAGS=${CFLAGS}"
(cd src/gambit && ./configure $gambit_config) || die

rm -f build-env.sh
Expand Down
2 changes: 1 addition & 1 deletion src/build/build-libgerbil.ss
Original file line number Diff line number Diff line change
Expand Up @@ -390,7 +390,7 @@
(let (libgerbil-ldd (filter (? (not string-empty?)) (string-split ld-options #\space)))
(if (eq? mode 'shared)
(invoke-gcc ["-shared" "-o" libgerbil
shared-ld-opts ...
libgerbil-ldd ...
gx-gambc-o-paths ...
static-module-o-paths ...
builtin-modules-o-path
Expand Down

0 comments on commit d70df51

Please sign in to comment.