concurrencykit / ck

Concurrency primitives, safe memory reclamation mechanisms and non-blocking (including lock-free) data structures designed to aid in the research, design and implementation of high performance concurrent systems developed in C99+.

Home Page:http://concurrencykit.org/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

32-bit not detected correctly on a 32-bit chroot / PROFILE incorrectly set

ConiKost opened this issue · comments

As a Gentoo developer, I am also running tests, so I can always ensure, that a package runs on a target x86 and amd64 host. Since I am only running amd64 nowerdays, I am running a x86 Gentoo only in a chroot inside of my amd64 system.

This seems to be somehow a problem for ck, as it wrongly tries to compile for 64-bit, while running in a 32-bit chroot. I can successfully workaround that by setting PROFILE=x86 . This makes it successfully compiling.

The problems seems to be a wrong auto detection of PROFILE.

./configure --prefix=/usr --build=i686-pc-linux-gnu --host=i686-pc-linux-gnu --mandir=/usr/share/man --infodir=/usr/share/info --datadir=/usr/share --sysconfdir=/etc --localstatedir=/var/lib --libdir=/usr/lib --disable-static
Detecting operating system.......success [linux]
Detecting machine architecture...success [x86_64]
Finding dirname command..........success [/usr/bin/dirname]
Determining build directory......success [/var/tmp/portage/dev-libs/concurrencykit-0.7.0-r1/work/ck-0.7.0]
Finding suitable compiler........success [/usr/bin/i686-pc-linux-gnu-gcc]
Finding suitable archiver........success [/usr/bin/i686-pc-linux-gnu-ar]
Detecting VMA bits...............success [48]
Checking header file usability...success [stdbool.h]
Checking header file usability...success [stddef.h]
Checking header file usability...success [stdint.h]
Checking header file usability...success [string.h]
Detecting git SHA................which: no git in (/usr/lib/portage/python3.7/ebuild-helpers/xattr:/usr/lib/portage/python3.7/ebuild-helpers:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/opt/bin)
git not installed or executable []
Generating header files..........success
Generating build files...........success

           VERSION = 0.7.0
           GIT_SHA =
         BUILD_DIR = /var/tmp/portage/dev-libs/concurrencykit-0.7.0-r1/work/ck-0.7.0
           SRC_DIR = /var/tmp/portage/dev-libs/concurrencykit-0.7.0-r1/work/ck-0.7.0
            SYSTEM = linux
           PROFILE = x86_64
                AR = /usr/bin/i686-pc-linux-gnu-ar
                CC = /usr/bin/i686-pc-linux-gnu-gcc
          COMPILER = gcc
            CFLAGS = -D_XOPEN_SOURCE=600 -D_BSD_SOURCE -D_DEFAULT_SOURCE -std=gnu99 -pedantic -Wall -W -Wundef -Wendif-labels -Wshadow -Wpointer-arith -Wcast-align -Wcast-qual -Wwrite-strings -Wstrict-prototypes -Wmissing-prototypes -Wnested-externs -Winline -Wdisabled-optimization -fstrict-aliasing -O2 -pipe -Wno-parentheses -O2 -march=i686 -pipe -fPIC
    PTHREAD_CFLAGS = -pthread
                LD = /usr/bin/i686-pc-linux-gnu-gcc
            LDNAME = libck.so
    LDNAME_VERSION = libck.so.0.7.0
      LDNAME_MAJOR = libck.so.0
           LDFLAGS = -Wl,-soname,libck.so.0 -m64 -Wl,-O1 -Wl,--as-needed -shared -fPIC
        STATIC_LIB = 1
              GZIP = cat
             CORES = 12
      POINTER_PACK = CK_MD_POINTER_PACK_DISABLE
      PPC32_LWSYNC = CK_MD_PPC32_LWSYNC_DISABLE
          VMA_BITS = 48
      MEMORY_MODEL = CK_MD_TSO
               RTM = CK_MD_RTM_DISABLE
               LSE = CK_MD_LSE_DISABLE
               SSE = CK_MD_SSE_ENABLE

Headers will be installed in /usr/include
Libraries will be installed in /usr/lib
Documentation will be installed in /usr/share/man
>>> Source configured.
>>> Compiling source in /var/tmp/portage/dev-libs/concurrencykit-0.7.0-r1/work/ck-0.7.0 ...
make -j1
make -C doc all || exit
make[1]: Entering directory '/var/tmp/portage/dev-libs/concurrencykit-0.7.0-r1/work/ck-0.7.0/doc'
for target in CK_ARRAY_FOREACH ck_array_buffer ck_array_commit ck_array_deinit ck_array_init ck_array_initialized ck_array_length ck_array_put ck_array_put_unique ck_array_remove ck_array_deinit ck_brlock ck_ht_count ck_ht_destroy ck_ht_gc ck_ht_get_spmc ck_ht_grow_spmc ck_ht_hash ck_ht_hash_direct ck_ht_init ck_ht_put_spmc ck_ht_remove_spmc ck_ht_reset_spmc ck_ht_reset_size_spmc ck_ht_set_spmc ck_ht_entry_empty ck_ht_entry_key ck_ht_entry_key_direct ck_ht_entry_key_length ck_ht_entry_key_set ck_ht_entry_key_set_direct ck_ht_entry_set ck_ht_entry_set_direct ck_ht_entry_value_direct ck_ht_entry_value ck_ht_iterator_init ck_ht_next ck_ht_stat ck_bitmap_init ck_bitmap_reset ck_bitmap_set ck_bitmap_bts ck_bitmap_test ck_bitmap_base ck_bitmap_union ck_bitmap_size ck_bitmap_clear ck_bitmap_bits ck_bitmap_buffer ck_bitmap_next ck_bitmap_iterator_init ck_elide ck_epoch_barrier ck_epoch_begin ck_epoch_call ck_epoch_end ck_epoch_init ck_epoch_poll ck_epoch_recycle ck_epoch_register ck_epoch_reclaim ck_epoch_synchronize ck_epoch_unregister ck_hs_gc ck_hs_init ck_hs_destroy CK_HS_HASH ck_hs_apply ck_hs_iterator_init ck_hs_next ck_hs_get ck_hs_put ck_hs_put_unique ck_hs_set ck_hs_fas ck_hs_remove ck_hs_move ck_hs_grow ck_hs_rebuild ck_hs_count ck_hs_reset ck_hs_reset_size ck_hs_stat ck_rhs_gc ck_rhs_init ck_rhs_destroy CK_RHS_HASH ck_rhs_apply ck_rhs_iterator_init ck_rhs_next ck_rhs_get ck_rhs_put ck_rhs_put_unique ck_rhs_set ck_rhs_fas ck_rhs_remove ck_rhs_move ck_rhs_grow ck_rhs_rebuild ck_rhs_count ck_rhs_reset ck_rhs_reset_size ck_rhs_stat ck_rwcohort CK_RWCOHORT_INIT CK_RWCOHORT_INSTANCE CK_RWCOHORT_PROTOTYPE CK_RWCOHORT_READ_LOCK CK_RWCOHORT_READ_UNLOCK CK_RWCOHORT_WRITE_LOCK CK_RWCOHORT_WRITE_UNLOCK ck_cohort CK_COHORT_PROTOTYPE CK_COHORT_TRYLOCK_PROTOTYPE CK_COHORT_INSTANCE CK_COHORT_INIT CK_COHORT_LOCK CK_COHORT_UNLOCK CK_COHORT_TRYLOCK ck_pr ck_pr_fence_acquire ck_pr_fence_release ck_pr_barrier ck_pr_fas ck_pr_fence_atomic ck_pr_fence_atomic_load ck_pr_fence_atomic_store ck_pr_fence_load ck_pr_fence_load_atomic ck_pr_fence_load_store ck_pr_fence_load_depends ck_pr_fence_memory ck_pr_fence_store ck_pr_fence_store_atomic ck_pr_fence_store_load ck_pr_stall ck_pr_faa ck_pr_inc ck_pr_dec ck_pr_not ck_pr_neg ck_pr_add ck_pr_sub ck_pr_and ck_pr_xor ck_pr_or ck_pr_cas ck_pr_bts ck_pr_btc ck_pr_btr ck_pr_store ck_pr_load ck_pr_rtm ck_queue ck_ring_init ck_ring_dequeue_spmc ck_ring_enqueue_spmc ck_ring_enqueue_spmc_size ck_ring_trydequeue_spmc ck_ring_dequeue_spsc ck_ring_enqueue_spsc ck_ring_enqueue_spsc_size ck_ring_size ck_ring_capacity ck_tflock ck_rwlock ck_pflock ck_swlock ck_sequence ck_spinlock; do                           \
        cat /var/tmp/portage/dev-libs/concurrencykit-0.7.0-r1/work/ck-0.7.0/doc/$target > /var/tmp/portage/dev-libs/concurrencykit-0.7.0-r1/work/ck-0.7.0/doc/$target.3; \
done
make[1]: Leaving directory '/var/tmp/portage/dev-libs/concurrencykit-0.7.0-r1/work/ck-0.7.0/doc'
---[ Manual pages are ready for installation.
make -C src all || exit
make[1]: Entering directory '/var/tmp/portage/dev-libs/concurrencykit-0.7.0-r1/work/ck-0.7.0/src'
/usr/bin/i686-pc-linux-gnu-gcc -D_XOPEN_SOURCE=600 -D_BSD_SOURCE -D_DEFAULT_SOURCE -std=gnu99 -pedantic -Wall -W -Wundef -Wendif-labels -Wshadow -Wpointer-arith -Wcast-align -Wcast-qual -Wwrite-strings -Wstrict-prototypes -Wmissing-prototypes -Wnested-externs -Winline -Wdisabled-optimization -fstrict-aliasing -O2 -pipe -Wno-parentheses -O2 -march=i686 -pipe -fPIC -D_XOPEN_SOURCE=600 -D_BSD_SOURCE -D_DEFAULT_SOURCE -std=gnu99 -pedantic -Wall -W -Wundef -Wendif-labels -Wshadow -Wpointer-arith -Wcast-align -Wcast-qual -Wwrite-strings -Wstrict-prototypes -Wmissing-prototypes -Wnested-externs -Winline -Wdisabled-optimization -fstrict-aliasing -O2 -pipe -Wno-parentheses -O2 -march=i686 -pipe -fPIC -I/var/tmp/portage/dev-libs/concurrencykit-0.7.0-r1/work/ck-0.7.0/include -I/var/tmp/portage/dev-libs/concurrencykit-0.7.0-r1/work/ck-0.7.0/include -m64 -D__x86_64__ -c -o /var/tmp/portage/dev-libs/concurrencykit-0.7.0-r1/work/ck-0.7.0/src/ck_barrier_centralized.o /var/tmp/portage/dev-libs/concurrencykit-0.7.0-r1/work/ck-0.7.0/src/ck_barrier_centralized.c
cc1: error: CPU you selected does not support x86-64 instruction set

I'd be inclined to blame linux on this, for reporting x86_64 for a 32bits uname.
Is having to set PROFILE a real issue ?

No. If you say, that setting PROFILE is okay and doesn't have any other negative sides (assuming, that I have choosen the correct setting for PROFILE) I am fine with that.

Does setting PLATFORM to i686 does the trick ? I'd be more confident in that.

Yes, setting PLATFORM=i686 instead of PROFILE=x86 seems to work.