Commit 311c98eb authored by Sara Golemon's avatar Sara Golemon

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
parent a4d8d010
/* /*
* Copyright 2013 Facebook, Inc. * Copyright 2014 Facebook, Inc.
* *
* Licensed under the Apache License, Version 2.0 (the "License"); * Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License. * you may not use this file except in compliance with the License.
...@@ -24,7 +24,8 @@ namespace folly { ...@@ -24,7 +24,8 @@ namespace folly {
namespace detail { 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 // Fast SIMD implementation of CRC-32C for x86 with SSE 4.2
uint32_t crc32c_hw(const uint8_t *data, size_t nbytes, uint32_t crc32c_hw(const uint8_t *data, size_t nbytes,
......
/* /*
* Copyright 2013 Facebook, Inc. * Copyright 2014 Facebook, Inc.
* *
* Licensed under the Apache License, Version 2.0 (the "License"); * Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License. * you may not use this file except in compliance with the License.
...@@ -18,7 +18,9 @@ ...@@ -18,7 +18,9 @@
extern "C" { extern "C" {
#ifndef FOLLY_HAVE_WEAK_SYMBOLS
int (*rallocm)(void**, size_t*, size_t, size_t, int) = nullptr; int (*rallocm)(void**, size_t*, size_t, size_t, int) = nullptr;
int (*allocm)(void**, size_t*, size_t, int) = nullptr; int (*allocm)(void**, size_t*, size_t, int) = nullptr;
#endif
} }
/* /*
* Copyright 2013 Facebook, Inc. * Copyright 2014 Facebook, Inc.
* *
* Licensed under the Apache License, Version 2.0 (the "License"); * Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License. * you may not use this file except in compliance with the License.
...@@ -18,11 +18,14 @@ ...@@ -18,11 +18,14 @@
#define FOLLY_DETAIL_MALLOC_H #define FOLLY_DETAIL_MALLOC_H
#include <stdlib.h> #include <stdlib.h>
#ifndef FOLLY_NO_CONFIG
#include "folly/folly-config.h" #include "folly/folly-config.h"
#endif
extern "C" { 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 rallocm(void**, size_t*, size_t, size_t, int) __attribute__((weak));
int allocm(void**, size_t*, size_t, int) __attribute__((weak)); int allocm(void**, size_t*, size_t, int) __attribute__((weak));
#else #else
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment