Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Changes to have compile work for ARM Linux systems #158

Open
wants to merge 10 commits into
base: master
Choose a base branch
from
9 changes: 9 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,2 +1,11 @@
*.o
*.a
*.so
pCloudCC/CMakeCache.txt
pCloudCC/CMakeFiles/
pCloudCC/Makefile
pCloudCC/cmake_install.cmake
pCloudCC/install_manifest.txt
pCloudCC/lib/mbedtls/Makefile
pCloudCC/lib/mbedtls/library/Makefile
pCloudCC/pcloudcc
17 changes: 17 additions & 0 deletions install_debian.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
#!/bin/sh
sudo apt-get install cmake zlib1g-dev libboost-system-dev libboost-program-options-dev libpthread-stubs0-dev libfuse-dev libudev-dev git
mkdir console-client
git clone https://github.com/pcloudcom/console-client.git ./console-client/
cd ./console-client/pCloudCC/
cd lib/pclsync/
make clean
make fs
cd ../mbedtls/
cmake .
make clean
make
cd ../..
cmake .
make
sudo make install
ldconfig
4 changes: 2 additions & 2 deletions pCloudCC/lib/mbedtls/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ project(MBEDTLS C)
string(REGEX MATCH "Clang" CMAKE_COMPILER_IS_CLANG "${CMAKE_C_COMPILER_ID}")
set (CMAKE_INSTALL_LOCAL_ONLY ON)
if(CMAKE_COMPILER_IS_GNUCC)
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Wall -Wextra -W -Wdeclaration-after-statement -Wwrite-strings -Wlogical-op -fPIC")
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -fomit-frame-pointer -Wall -Wextra -W -Wdeclaration-after-statement -Wwrite-strings -Wlogical-op -fPIC")
set(CMAKE_C_FLAGS_RELEASE "-O2")
set(CMAKE_C_FLAGS_DEBUG "-O0 -g3")
set(CMAKE_C_FLAGS_COVERAGE "-O0 -g3 --coverage")
Expand All @@ -15,7 +15,7 @@ if(CMAKE_COMPILER_IS_GNUCC)
endif(CMAKE_COMPILER_IS_GNUCC)

if(CMAKE_COMPILER_IS_CLANG)
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Wall -Wextra -W -Wdeclaration-after-statement -Wwrite-strings -Wpointer-arith")
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -fomit-frame-pointer -Wall -Wextra -W -Wdeclaration-after-statement -Wwrite-strings -Wpointer-arith")
set(CMAKE_C_FLAGS_RELEASE "-O2")
set(CMAKE_C_FLAGS_DEBUG "-O0 -g3")
set(CMAKE_C_FLAGS_COVERAGE "-O0 -g3 --coverage")
Expand Down
18 changes: 9 additions & 9 deletions pCloudCC/lib/pclsync/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -4,16 +4,16 @@ RANLIB=ranlib
#USESSL=openssl
USESSL=mbed

#CFLAGS=-Wall -Wpointer-arith -O2 -g -mtune=core2
CFLAGS=-Wall -Wpointer-arith -O2 -g -fno-stack-protector -fomit-frame-pointer -mtune=core2 -I../sqlite -DP_ELECTRON -fPIC

#CFLAGS=-Wall -Wpointer-arith -O2 -g -fsanitize=address -mtune=core2
#CFLAGS=-Wall -Wpointer-arith -O2 -g -fsanitize=address -mtune=core2 -I../sqlite
#CFLAGS=-Wall -Wpointer-arith -Os -g -mtune=core2 -I../sqlite -pg
#CFLAGS=-Wall -Wpointer-arith -O2 -g -fno-stack-protector -fomit-frame-pointer -mtune=core2 -I../sqlite/ -fPIC
#CFLAGS=-Wall -Wpointer-arith -O2 -g -mtune=core2 -I../sqlite -pg -m32 -D_FILE_OFFSET_BITS=64
#CFLAGS=-Wall -Wpointer-arith -O2 -g
CFLAGS=-Wall -Wpointer-arith -O2 -g -fno-stack-protector -fomit-frame-pointer -I../sqlite -DP_ELECTRON -fPIC

#CFLAGS=-Wall -Wpointer-arith -O2 -g -fsanitize=address
#CFLAGS=-Wall -Wpointer-arith -O2 -g -fsanitize=address -I../sqlite
#CFLAGS=-Wall -Wpointer-arith -Os -g -I../sqlite -pg
#CFLAGS=-Wall -Wpointer-arith -O2 -g -fno-stack-protector -fomit-frame-pointer -I../sqlite/ -fPIC
#CFLAGS=-Wall -Wpointer-arith -O2 -g -I../sqlite -pg -m32 -D_FILE_OFFSET_BITS=64
#CFLAGS=-O2 -g -pg
#CFLAGS=-Wall -Wpointer-arith -O2 -g -mtune=core2 -I../../psync32/zlib -I../../psync32/sqlite -m32 -D_FILE_OFFSET_BITS=64
#CFLAGS=-Wall -Wpointer-arith -O2 -g -I../../psync32/zlib -I../../psync32/sqlite -m32 -D_FILE_OFFSET_BITS=64

LIB_A=psynclib.a
#LIB_A=libpsynclib.a
Expand Down
2 changes: 2 additions & 0 deletions pCloudCC/lib/pclsync/pcompat.h
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,9 @@

#define P_OS_ID 7

#ifndef _GNU_SOURCE
#define _GNU_SOURCE
#endif

#else

Expand Down
10 changes: 5 additions & 5 deletions pCloudCC/lib/pclsync/pcompiler.h
Original file line number Diff line number Diff line change
Expand Up @@ -45,23 +45,23 @@
#endif
#endif

#ifndef __has_builtin
#ifndef PSYNC_HAS_BUILTIN
#if defined(__GNUC__)
#define __has_builtin(x) 1
#define PSYNC_HAS_BUILTIN(x) 1
#else
#define __has_builtin(x) 0
#define PSYNC_HAS_BUILTIN(x) 0
#endif
#endif

#if __has_builtin(__builtin_expect)
#if PSYNC_HAS_BUILTIN(__builtin_expect)
#define likely(expr) __builtin_expect(!!(expr), 1)
#define unlikely(expr) __builtin_expect(!!(expr), 0)
#else
#define likely(expr) (expr)
#define unlikely(expr) (expr)
#endif

#if __has_builtin(__builtin_prefetch)
#if PSYNC_HAS_BUILTIN(__builtin_prefetch)
#define psync_prefetch(expr) __builtin_prefetch(expr)
#elif defined(_MSC_VER)
#define psync_prefetch(expr) _mm_prefetch((char *)(expr), _MM_HINT_T0)
Expand Down
1 change: 1 addition & 0 deletions pCloudCC/lib/pclsync/pfs.c
Original file line number Diff line number Diff line change
Expand Up @@ -3415,6 +3415,7 @@ static int psync_fs_do_start(){
#if defined(P_OS_LINUX)
fuse_opt_add_arg(&args, "argv");
fuse_opt_add_arg(&args, "-oauto_unmount");
fuse_opt_add_arg(&args, "-oallow_others"); // Hack allow all users
// fuse_opt_add_arg(&args, "-ouse_ino");
fuse_opt_add_arg(&args, "-ofsname="DEFAULT_FUSE_MOUNT_POINT".fs");
if (!is_fuse3_installed_on_system()) {
Expand Down
2 changes: 1 addition & 1 deletion pCloudCC/lib/pclsync/psettings.h
Original file line number Diff line number Diff line change
Expand Up @@ -237,7 +237,7 @@
#define PSYNC_FS_MAX_READAHEAD (16*1024*1024)
#define PSYNC_FS_MAX_READAHEAD_IF_SEC (64*1024*1024)
#define PSYNC_FS_MAX_READAHEAD_SEC 16
#define PSYNC_FS_DEFAULT_CACHE_SIZE ((uint64_t)5*1024*1024*1024)
#define PSYNC_FS_DEFAULT_CACHE_SIZE ((uint64_t)64*1024*1024)
#define PSYNC_FS_DIRECT_UPLOAD_LIMIT (256*1024)
#define PSYNC_FS_FILESIZE_FOR_2CONN (4*1024*1024)
#define PSYNC_FS_FILE_LOC_HIST_SEC 30
Expand Down