Skip to content

Fails to compile on ARM Linux #7

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

Closed
stronnag opened this issue Jun 22, 2019 · 5 comments
Closed

Fails to compile on ARM Linux #7

stronnag opened this issue Jun 22, 2019 · 5 comments

Comments

@stronnag
Copy link

On Arch Linux, ARM 32 bit:

 $ cmake ../../
-- The C compiler identification is GNU 8.3.0
-- Check for working C compiler: /usr/bin/cc
-- Check for working C compiler: /usr/bin/cc -- works
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Detecting C compile features
-- Detecting C compile features - done
-- No build type selected, default to *** Release ***
-- Override standard malloc (OVERRIDE=ON)
-- Output library name   : mimalloc
-- Installation directory: lib/mimalloc-1.0
-- Configuring done
-- Generating done
-- Build files have been written to: /home/jrh/Projects/mimalloc/out/release
$ make
Scanning dependencies of target mimalloc-static
[  4%] Building C object CMakeFiles/mimalloc-static.dir/src/stats.c.o
In file included from /home/jrh/Projects/mimalloc/src/stats.c:8:
/home/jrh/Projects/mimalloc/include/mimalloc-internal.h: In function ‘_mi_thread_id’:
/home/jrh/Projects/mimalloc/include/mimalloc-internal.h:312:22: error: ‘_mi_backing_heap’ undeclared (first use in this function); did you mean ‘_mi_bin_size’?
   return (uintptr_t)&_mi_backing_heap;
                      ^~~~~~~~~~~~~~~~
                      _mi_bin_size
/home/jrh/Projects/mimalloc/include/mimalloc-internal.h:312:22: note: each undeclared identifier is reported only once for each function it appears in
make[2]: *** [CMakeFiles/mimalloc-static.dir/build.make:63: CMakeFiles/mimalloc-static.dir/src/stats.c.o] Error 1
make[1]: *** [CMakeFiles/Makefile2:73: CMakeFiles/mimalloc-static.dir/all] Error 2
make: *** [Makefile:130: all] Error 2
@daanx
Copy link
Collaborator

daanx commented Jun 22, 2019

Ah, never tried building on ARM yet. I just pushed a possible fix to master -- can you try that?

Beyond that, the code at:
https://github.com/microsoft/mimalloc/blob/master/include/mimalloc-internal.h#L288

uses special casing to efficiently get a thread unique id. I am sure ARM will have this too and it we should add such case (for best performance).

@stronnag
Copy link
Author

Thanks for the amazingly fast reply; the compile error moves on:

Scanning dependencies of target mimalloc-static
[  4%] Building C object CMakeFiles/mimalloc-static.dir/src/stats.c.o
In file included from /home/jrh/Projects/mimalloc/src/stats.c:8:
/home/jrh/Projects/mimalloc/include/mimalloc-internal.h: In function ‘mi_get_default_heap’:
/home/jrh/Projects/mimalloc/include/mimalloc-internal.h:156:10: error: ‘_mi_’ undeclared (first use in this function); did you mean ‘_mi_bsr’?
   return _mi_
          ^~~~
          _mi_bsr
/home/jrh/Projects/mimalloc/include/mimalloc-internal.h:156:10: note: each undeclared identifier is reported only once for each function it appears in
/home/jrh/Projects/mimalloc/include/mimalloc-internal.h:156:14: error: expected ‘;’ before ‘ault’
   return _mi_
              ^
              ;
   ault;
   ~~~~        
make[2]: *** [CMakeFiles/mimalloc-static.dir/build.make:63: CMakeFiles/mimalloc-static.dir/src/stats.c.o] Error 1
make[1]: *** [CMakeFiles/Makefile2:73: 

@daanx
Copy link
Collaborator

daanx commented Jun 22, 2019

Argh, accidental mistake in the fix. Can you try again?
(and from now I will switch to the dev branch for quick fixes :-) )

@stronnag
Copy link
Author

Building (and running) --- thanks.

@daanx
Copy link
Collaborator

daanx commented Jun 22, 2019

Good to hear! -- I'll look into doing efficient thread id detection on ARM (any pointers are appreciated).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants