Skip to content

Building 1.6.1 with --enable-gc fails #227

Closed

Description

@timtadh

It fails with a linker error because the BDW_GC_LIBS are not everywhere they need to be. I believe the following patch fixes that.

From 2174299ab61dea6bf968bca2bc50f235e23ef30e Mon Sep 17 00:00:00 2001
From: Tim Henderson <[email protected]>
Date: Wed, 12 Mar 2014 15:57:53 -0400
Subject: [PATCH] fix build with --enable-gc

Signed-off-by: Tim Henderson <[email protected]>

---
 src/nix-daemon/Makefile.am        | 2 +-
 src/nix-env/Makefile.am           | 2 +-
 src/nix-hash/Makefile.am          | 2 +-
 src/nix-instantiate/Makefile.am   | 2 +-
 src/nix-setuid-helper/Makefile.am | 2 +-
 src/nix-store/Makefile.am         | 2 +-
 6 files changed, 6 insertions(+), 6 deletions(-)

diff --git a/src/nix-daemon/Makefile.am b/src/nix-daemon/Makefile.am
index b8e9f4a..423ec4a 100644
--- a/src/nix-daemon/Makefile.am
+++ b/src/nix-daemon/Makefile.am
@@ -2,7 +2,7 @@ bin_PROGRAMS = nix-daemon

 nix_daemon_SOURCES = nix-daemon.cc
 nix_daemon_LDADD = ../libmain/libmain.la ../libstore/libstore.la ../libutil/libutil.la \
- ../boost/format/libformat.la
+ ../boost/format/libformat.la @BDW_GC_LIBS@

 AM_CXXFLAGS = \
  -I$(srcdir)/.. -I$(srcdir)/../libutil \
diff --git a/src/nix-env/Makefile.am b/src/nix-env/Makefile.am
index 4d3bd11..3f10305 100644
--- a/src/nix-env/Makefile.am
+++ b/src/nix-env/Makefile.am
@@ -4,7 +4,7 @@ nix_env_SOURCES = nix-env.cc profiles.cc profiles.hh user-env.cc user-env.hh

 nix_env_LDADD = ../libmain/libmain.la ../libexpr/libexpr.la \
  ../libstore/libstore.la ../libutil/libutil.la \
- ../boost/format/libformat.la
+ ../boost/format/libformat.la @BDW_GC_LIBS@

 AM_CXXFLAGS = \
  -I$(srcdir)/.. \
diff --git a/src/nix-hash/Makefile.am b/src/nix-hash/Makefile.am
index ef7bb84..da3bf26 100644
--- a/src/nix-hash/Makefile.am
+++ b/src/nix-hash/Makefile.am
@@ -2,7 +2,7 @@ bin_PROGRAMS = nix-hash

 nix_hash_SOURCES = nix-hash.cc
 nix_hash_LDADD = ../libmain/libmain.la ../libstore/libstore.la ../libutil/libutil.la \
- ../boost/format/libformat.la
+ ../boost/format/libformat.la @BDW_GC_LIBS@

 AM_CXXFLAGS = \
  -I$(srcdir)/.. -I$(srcdir)/../libutil -I$(srcdir)/../libstore -I$(srcdir)/../libmain
diff --git a/src/nix-instantiate/Makefile.am b/src/nix-instantiate/Makefile.am
index 96978f3..24902ae 100644
--- a/src/nix-instantiate/Makefile.am
+++ b/src/nix-instantiate/Makefile.am
@@ -3,7 +3,7 @@ bin_PROGRAMS = nix-instantiate
 nix_instantiate_SOURCES = nix-instantiate.cc
 nix_instantiate_LDADD = ../libmain/libmain.la ../libexpr/libexpr.la \
  ../libstore/libstore.la ../libutil/libutil.la \
- ../boost/format/libformat.la
+ ../boost/format/libformat.la @BDW_GC_LIBS@

 AM_CXXFLAGS = \
  -I$(srcdir)/.. -I$(srcdir)/../libutil -I$(srcdir)/../libstore \
diff --git a/src/nix-setuid-helper/Makefile.am b/src/nix-setuid-helper/Makefile.am
index a047016..42afb88 100644
--- a/src/nix-setuid-helper/Makefile.am
+++ b/src/nix-setuid-helper/Makefile.am
@@ -2,6 +2,6 @@ libexec_PROGRAMS = nix-setuid-helper

 nix_setuid_helper_SOURCES = nix-setuid-helper.cc
 nix_setuid_helper_LDADD = ../libutil/libutil.la \
- ../boost/format/libformat.la
+ ../boost/format/libformat.la @BDW_GC_LIBS@

 AM_CXXFLAGS = -I$(srcdir)/.. -I$(srcdir)/../libutil
diff --git a/src/nix-store/Makefile.am b/src/nix-store/Makefile.am
index fca9eff..7e95361 100644
--- a/src/nix-store/Makefile.am
+++ b/src/nix-store/Makefile.am
@@ -5,7 +5,7 @@ nix_store_SOURCES =     \
   xmlgraph.cc xmlgraph.hh

 nix_store_LDADD = ../libmain/libmain.la ../libstore/libstore.la ../libutil/libutil.la \
- ../boost/format/libformat.la -lbz2
+ ../boost/format/libformat.la -lbz2 @BDW_GC_LIBS@

 AM_CXXFLAGS = \
  -I$(srcdir)/.. -I$(srcdir)/../libutil \
-- 
1.8.1.2

Activity

  1. edolstra commented on Apr 15, 2014

    @edolstra
    Member

    Can you try this with Nix 1.7? (The build system changed so this patch won't apply.)

  2. timtadh commented on Apr 15, 2014

    @timtadh
    Author

    Ok, trying now. Here are my options

    cd nix
    git clean -fdx
    ./bootstrap.sh
    ./configure --prefix=/opt/nix \
                --enable-gc \
                --with-docbook-rng=/usr/share/xml/docbook/schema/rng/5.0/ \
                --with-docbook-xsl=/usr/share/xml/docbook/stylesheet/docbook-xsl-ns/ \
    && touch NEWS.txt NEWS \
    && make \
    && sudo make install
    cd -
    
  3. timtadh commented on Apr 15, 2014

    @timtadh
    Author

    In my basic testing it looks like it works. I think you can close the bug.

  4. edolstra commented on Apr 15, 2014

    @edolstra
    Member

    Thanks, closing.

  5. added a commit that references this issue on Jan 1, 2024
  6. added a commit that references this issue on Feb 26, 2025
  7. added a commit that references this issue on Mar 8, 2026
    be438c6
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions