Skip to content

Add a Makefile option to disable libunwind #22215

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

Merged
merged 1 commit into from
Jun 10, 2017
Merged

Add a Makefile option to disable libunwind #22215

merged 1 commit into from
Jun 10, 2017

Conversation

Keno
Copy link
Member

@Keno Keno commented Jun 4, 2017

There's been a request for a version of julia that does not depend on
libunwind, for easier bring up on new architectures. This adds a makefile
flag that can be put in Make.user (DISABLE_LIBUNWIND) and if set, will
disable any dependency on libunwind. Backtraces and profiling won't work
of course.

@@ -597,7 +597,7 @@ static inline void jl_set_gc_and_wait(void)
}
#endif

void jl_dump_native(const char *bc_fname, const char *obj_fname, const char *sysimg_data, size_t sysimg_len);
void jl_dump_native(const char *bc_fname, const char *bc_unopt_fname, const char *obj_fname, const char *sysimg_data, size_t sysimg_len);
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Some unrelated changes crept in during rebase. Will take them out in the morning.

@@ -26,6 +26,7 @@ OPENBLAS_USE_THREAD:=1
# Use libraries available on the system instead of building them
USE_SYSTEM_LLVM:=0
USE_SYSTEM_LIBUNWIND:=0
DISABLE_LIBUNWIND:=0
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We generally try to avoid double negatives in options, although in this case everything else defaults to false.

@ararslan ararslan added the building Build system, or building Julia or its dependencies label Jun 5, 2017
@ararslan
Copy link
Member

ararslan commented Jun 5, 2017

@jlbuild !flags=DISABLE_LIBUNWIND=1 !nuke

@jlbuild
Copy link

jlbuild commented Jun 5, 2017

Status of 1ae7636 builds:

Builder Name Nuke Build Download
linux32 COMPLETE ERRORED N/A
linux64 COMPLETE ERRORED N/A
linuxaarch64 COMPLETE ERRORED N/A
linuxarmv7l COMPLETE ERRORED N/A
linuxppc64le COMPLETE ERRORED N/A
osx64 COMPLETE ERRORED N/A
win32 CANCELED N/A N/A
win64 COMPLETE ERRORED N/A

@claudefalbriard
Copy link

When running the make under s390x, even having libunwind disabled, I receive the following error
at the build:

make USE_SYSTEM_PCRE=1 PCRE= USE_SYSTEM_*=1 USE_SYSTEM_LIBM=1 USE_SYSTEM_BLAS=1 NO_LAPACK=1 USE_SYSTEM_LLVM=0 DISABLE_LIBUNWIND=1

checking for build architecture... s390x
checking for host architecture... s390x
checking for target architecture... s390x
checking for target operating system... linux-gnu
checking for ELF helper width... configure: error: Unknown ELF target: s390x
/data/shared/julia/julia-master/deps/unwind.mk:36: recipe for target 'scratch/libunwind-1.1-julia2/build-configured' failed
make[1]: *** [scratch/libunwind-1.1-julia2/build-configured] Error 1
Makefile:85: recipe for target 'julia-deps' failed
make: *** [julia-deps] Error 2

@Keno
Copy link
Member Author

Keno commented Jun 5, 2017

Pushed an update to disable it trying to download libunwind if the make option is set.

@claudefalbriard
Copy link

Just downloaded latest master distribution, but still getting the following error at the make step, using makefile flag DISABLE_LIBUNWIND=1

make DISABLE_LIBUNWIND=1 USE_SYSTEM_PCRE=1 PCRE= USE_SYSTEM_*=1 USE_SYSTEM_LIBM=1 USE_SYSTEM_BLAS=1 NO_LAPACK=1 USE_SYSTEM_LLVM=0

Error:
"checking for ELF helper width... configure: error: Unknown ELF target: s390x"

Question: If the LIBUNWIND package is in a disabled state, why does it check the architecture?

@tkelman
Copy link
Contributor

tkelman commented Jun 6, 2017

latest master distribution

Are you building on this branch kf/unwinddis ? This pull request hasn't been merged yet.

@claudefalbriard
Copy link

@tkelman thanks for the hint. I've downloaded the branch and executed the make again. The process went much further, but stopped at a module called flisp. Looks like a dependency issue due to missing libunwind files. Any advice how to fix this error? Here the error message:

    LINK src/flisp/flisp
gcc: error: /data/shared/julia/julia-kf-unwinddis/usr/lib/libunwind-generic.a: No such file or directory
gcc: error: /data/shared/julia/julia-kf-unwinddis/usr/lib/libunwind.a: No such file or directory
Makefile:83: recipe for target '/data/shared/julia/julia-kf-unwinddis/src/flisp/flisp' failed
make[2]: *** [/data/shared/julia/julia-kf-unwinddis/src/flisp/flisp] Error 1
Makefile:224: recipe for target 'flisp/libflisp.a' failed
make[1]: *** [flisp/libflisp.a] Error 2
Makefile:55: recipe for target 'julia_flisp.boot.inc.phony' failed
make: *** [julia_flisp.boot.inc.phony] Error 2

There's been a request for a version of julia that does not depend on
libunwind, for easier bring up on new architectures. This adds a makefile
flag that can be put in Make.user (`DISABLE_LIBUNWIND`) and if set, will
disable any dependency on libunwind. Backtraces and profiling won't work
of course.
@Keno
Copy link
Member Author

Keno commented Jun 6, 2017

I've updated this branch again to hopefully take care of that one as well.

@claudefalbriard
Copy link

@Keno , thanks for fixing this dependency. The latest downland of the branch and build process did throw the following error. Any advice how to correct this "core dumped" error at inference.ji?

Warning: git information unavailable; versioning information limited
/bin/sh: 1: llvm-config: not found
    PERL base/build_h.jl.phony
WARNING: Using boilerplate git version info
Warning: git information unavailable; versioning information limited
    JULIA usr/lib/julia/inference.ji
Segmentation fault (core dumped)
Makefile:215: recipe for target '/data/shared/julia/julia-kf-unwinddis/usr/lib/julia/inference.ji' failed
make[1]: *** [/data/shared/julia/julia-kf-unwinddis/usr/lib/julia/inference.ji] Error 139
Makefile:100: recipe for target 'julia-inference' failed
make: *** [julia-inference] Error 2

@ViralBShah
Copy link
Member

That error seems to now be beyond the scope of this issue.

@claudefalbriard
Copy link

@ViralBShah , I agree, certainty latest build error (core dumped) is not related any-more to this branch, so I decided to report it under the issue "Julia Build from Source / s390x Machine Architecture not Supported" [ issue #21474 ]. Hints how to debug the error are welcome. Thanks to all colleagues for fixing the LIBUNWIND dependency.

@Keno Keno merged commit 9be9cfa into master Jun 10, 2017
@ararslan ararslan deleted the kf/unwinddis branch June 10, 2017 19:28
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
building Build system, or building Julia or its dependencies
Projects
None yet
Development

Successfully merging this pull request may close these issues.

8 participants