From: Sara Golemon Date: Mon, 6 Jan 2014 19:35:44 +0000 (-0800) Subject: Some fixes for folly-oss repo. X-Git-Tag: v0.22.0~741 X-Git-Url: http://demsky.eecs.uci.edu/git/?a=commitdiff_plain;h=311c98eb62832be70d86cf949dc1e5127028b3ca;p=folly.git Some fixes for folly-oss repo. Summary: The __builtin_ia32_crc[qd]i() functions are GCC >= 4.8 specific folly-config.h includes must be wrapped in a FOLLY_NO_CONFIG guard FOLLY_HAVE_WEAK_SYMBOLS needs to apply to the cpp file as well as the header Closes #44 Closes #42 Test Plan: HHVM builds with recent folly Reviewed By: seanc@fb.com FB internal diff: D1117181 --- diff --git a/folly/Checksum.cpp b/folly/Checksum.cpp index 788e0a19..56e211d6 100644 --- a/folly/Checksum.cpp +++ b/folly/Checksum.cpp @@ -1,5 +1,5 @@ /* - * Copyright 2013 Facebook, Inc. + * Copyright 2014 Facebook, Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -24,7 +24,8 @@ namespace folly { namespace detail { -#if defined(__x86_64__) && defined (__GNUC__) +#if defined(__x86_64__) && defined(__GNUC__) && defined(__GNUC_MINOR__) && \ + (((__GNUC__ * 100) + __GNUC_MINOR__) >= 408) // Fast SIMD implementation of CRC-32C for x86 with SSE 4.2 uint32_t crc32c_hw(const uint8_t *data, size_t nbytes, diff --git a/folly/detail/Malloc.cpp b/folly/detail/Malloc.cpp index df076d58..64d30b54 100644 --- a/folly/detail/Malloc.cpp +++ b/folly/detail/Malloc.cpp @@ -1,5 +1,5 @@ /* - * Copyright 2013 Facebook, Inc. + * Copyright 2014 Facebook, Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -18,7 +18,9 @@ extern "C" { +#ifndef FOLLY_HAVE_WEAK_SYMBOLS int (*rallocm)(void**, size_t*, size_t, size_t, int) = nullptr; int (*allocm)(void**, size_t*, size_t, int) = nullptr; +#endif } diff --git a/folly/detail/Malloc.h b/folly/detail/Malloc.h index 484745c0..c3659184 100644 --- a/folly/detail/Malloc.h +++ b/folly/detail/Malloc.h @@ -1,5 +1,5 @@ /* - * Copyright 2013 Facebook, Inc. + * Copyright 2014 Facebook, Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -18,11 +18,14 @@ #define FOLLY_DETAIL_MALLOC_H #include + +#ifndef FOLLY_NO_CONFIG #include "folly/folly-config.h" +#endif extern "C" { -#if FOLLY_HAVE_WEAK_SYMBOLS +#ifdef FOLLY_HAVE_WEAK_SYMBOLS int rallocm(void**, size_t*, size_t, size_t, int) __attribute__((weak)); int allocm(void**, size_t*, size_t, int) __attribute__((weak)); #else