Skip to content

Commit 7b34d80

Browse files
committed
[MERGE #1312 @obastemur] cross-platform: Fix GCC lib Fedora X64 compile time issues
Merge pull request #1312 from obastemur:fedora_compile Fedora x64, we have only 1 failing test at the moment: 'test/Regex/BoiHardFail.js' Compile steps for Fedora 24 Install dependencies ``` sudo dnf group install -y "Development Tools" "C Development Tools and Libraries" sudo dnf install -y git cmake clang gcc gcc-c++ kernel-devel python sudo dnf install -y libuuid-devel lttng-ust-devel.x86_64 libunwind-devel.x86_64 libicu-devel.x86_64 ``` Clone && Compile ``` > git clone https://github.com/Microsoft/ChakraCore > cd ChakraCore > ./build.sh ```
2 parents c19c91e + 9202cf2 commit 7b34d80

File tree

3 files changed

+24
-0
lines changed

3 files changed

+24
-0
lines changed

pal/inc/pal.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6411,6 +6411,7 @@ PALIMPORT double __cdecl _copysign(double, double);
64116411

64126412
#if !defined(PAL_STDCPP_COMPAT) || defined(USING_PAL_STDLIB)
64136413

6414+
#ifdef PLATFORM_ACCEPTS_ABS_OVERLOAD
64146415
#ifdef __cplusplus
64156416
extern "C++" {
64166417

@@ -6420,6 +6421,7 @@ inline __int64 abs(__int64 _X) {
64206421

64216422
}
64226423
#endif
6424+
#endif
64236425

64246426
PALIMPORT void * __cdecl malloc(size_t);
64256427
PALIMPORT void __cdecl free(void *);

pal/src/configure.cmake

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -101,6 +101,21 @@ check_cxx_symbol_exists(_DEBUG sys/user.h USER_H_DEFINES_DEBUG)
101101
check_cxx_symbol_exists(_SC_PHYS_PAGES unistd.h HAVE__SC_PHYS_PAGES)
102102
check_cxx_symbol_exists(_SC_AVPHYS_PAGES unistd.h HAVE__SC_AVPHYS_PAGES)
103103

104+
check_cxx_source_runs("
105+
#include <stdlib.h>
106+
#include <stdio.h>
107+
108+
extern \"C++\" {
109+
inline long long abs(long long _X) {
110+
return llabs(_X);
111+
}
112+
}
113+
114+
int main(int argc, char **argv) {
115+
long long X = 123456789 + argc;
116+
printf(\"%lld\", abs(X));
117+
exit(0);
118+
}" PLATFORM_ACCEPTS_ABS_OVERLOAD)
104119
check_cxx_source_runs("
105120
#include <sys/param.h>
106121
#include <stdlib.h>

pal/src/include/pal/palinternal.h

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -677,4 +677,11 @@ inline T* InterlockedCompareExchangePointerT(
677677

678678
#endif // __cplusplus
679679

680+
#ifndef max
681+
#define max(a,b) (((a) > (b)) ? (a) : (b))
682+
#endif
683+
#ifndef min
684+
#define min(a,b) (((a) < (b)) ? (a) : (b))
685+
#endif
686+
680687
#endif /* _PAL_INTERNAL_H_ */

0 commit comments

Comments
 (0)