Skip to content

Commit

Permalink
Add support for ARM builds by explicitly copying ARM header file
Browse files Browse the repository at this point in the history
Fixes #72
  • Loading branch information
lfittl committed Nov 7, 2020
1 parent ccb72c5 commit 0ce3454
Show file tree
Hide file tree
Showing 2 changed files with 27 additions and 0 deletions.
1 change: 1 addition & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,7 @@ extract_source: $(PGDIR)
mkdir ./src/postgres/include
ruby ./scripts/extract_source.rb $(PGDIR)/ ./src/postgres/
cp $(PGDIR)/src/include/storage/dsm_impl.h ./src/postgres/include/storage
cp $(PGDIR)/src/include/port/atomics/arch-arm.h ./src/postgres/include/port/atomics
touch ./src/postgres/guc-file.c
# This causes compatibility problems on some Linux distros, with "xlocale.h" not being available
echo "#undef HAVE_LOCALE_T" >> ./src/postgres/include/pg_config.h
Expand Down
26 changes: 26 additions & 0 deletions src/postgres/include/port/atomics/arch-arm.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
/*-------------------------------------------------------------------------
*
* arch-arm.h
* Atomic operations considerations specific to ARM
*
* Portions Copyright (c) 2013-2017, PostgreSQL Global Development Group
*
* NOTES:
*
* src/include/port/atomics/arch-arm.h
*
*-------------------------------------------------------------------------
*/

/* intentionally no include guards, should only be included by atomics.h */
#ifndef INSIDE_ATOMICS_H
#error "should be included via atomics.h"
#endif

/*
* 64 bit atomics on ARM32 are implemented using kernel fallbacks and thus
* might be slow, so disable entirely. On ARM64 that problem doesn't exist.
*/
#if !defined(__aarch64__) && !defined(__aarch64)
#define PG_DISABLE_64_BIT_ATOMICS
#endif /* __aarch64__ || __aarch64 */

0 comments on commit 0ce3454

Please sign in to comment.