Skip to content

Commit

Permalink
Fixes for cpuid specific binaries patch
Browse files Browse the repository at this point in the history
Fixes #19822
  • Loading branch information
Keno committed Jan 2, 2017
1 parent 1c605d2 commit 65213d5
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 3 deletions.
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,7 @@ julia-inference : julia-base julia-ui-$(JULIA_BUILD_MODE) $(build_prefix)/.examp
@$(MAKE) $(QUIET_MAKE) -C $(BUILDROOT) $(build_private_libdir)/inference.ji JULIA_BUILD_MODE=$(JULIA_BUILD_MODE)

ifneq ($(CPUID_SPECIFIC_BINARIES), 0)
CPUID_TAG = _$(call spawn,$(JULIA_EXECUTABLE) --cpuid)
CPUID_TAG = _$(call exec,$(JULIA_EXECUTABLE) --cpuid)
else
CPUID_TAG =
endif
Expand Down
6 changes: 6 additions & 0 deletions src/sys.c
Original file line number Diff line number Diff line change
Expand Up @@ -460,6 +460,12 @@ JL_DLLEXPORT uint64_t jl_cpuid_tag(void)
}
#elif defined(CPUID_SPECIFIC_BINARIES)
#error "CPUID not available on this CPU. Turn off CPUID_SPECIFIC_BINARIES"
#else
// For architectures that don't have CPUID
JL_DLLEXPORT uint64_t jl_cpuid_tag(void)
{
return 0;
}
#endif

JL_DLLEXPORT int jl_uses_cpuid_tag()
Expand Down
4 changes: 2 additions & 2 deletions ui/repl.c
Original file line number Diff line number Diff line change
Expand Up @@ -177,7 +177,7 @@ static NOINLINE int true_main(int argc, char *argv[])
return 0;
}

extern uint64_t jl_cpuid_tag();
extern JL_DLLEXPORT uint64_t jl_cpuid_tag();

#ifndef _OS_WINDOWS_
int main(int argc, char *argv[])
Expand Down Expand Up @@ -245,7 +245,7 @@ int wmain(int argc, wchar_t *argv[], wchar_t *envp[])
#endif
if (argc >= 2 && strcmp((char *)argv[1], "--cpuid") == 0) {
/* Used by the build system to name CPUID-specific binaries */
printf("%llx", jl_cpuid_tag());
printf("%" PRIx64, jl_cpuid_tag());
return 0;
}
libsupport_init();
Expand Down

0 comments on commit 65213d5

Please sign in to comment.