From bda7dcb473807ba8663db763c7865b460101155c Mon Sep 17 00:00:00 2001 From: Plague Doctor Date: Tue, 7 Nov 2017 12:32:52 +1100 Subject: [PATCH 1/8] __has_builtin(x) defined in pcompiler.h hides definition in boost library. renamed has_builtin to: PSYNC_HAS_BUILTIN --- pCloudCC/lib/pclsync/pcompat.h | 2 ++ pCloudCC/lib/pclsync/pcompiler.h | 10 +++++----- 2 files changed, 7 insertions(+), 5 deletions(-) diff --git a/pCloudCC/lib/pclsync/pcompat.h b/pCloudCC/lib/pclsync/pcompat.h index c9fedb73..8c3c155e 100644 --- a/pCloudCC/lib/pclsync/pcompat.h +++ b/pCloudCC/lib/pclsync/pcompat.h @@ -92,7 +92,9 @@ #define P_OS_ID 7 +#ifndef _GNU_SOURCE #define _GNU_SOURCE +#endif #else diff --git a/pCloudCC/lib/pclsync/pcompiler.h b/pCloudCC/lib/pclsync/pcompiler.h index 61c68055..ffe55820 100644 --- a/pCloudCC/lib/pclsync/pcompiler.h +++ b/pCloudCC/lib/pclsync/pcompiler.h @@ -45,15 +45,15 @@ #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 @@ -61,7 +61,7 @@ #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) From 97900e90f13f261efd5d7a356680b3a644b39f9c Mon Sep 17 00:00:00 2001 From: Gordin <9ordin@gmail.com> Date: Sat, 18 May 2019 01:59:31 +0200 Subject: [PATCH 2/8] Makes compiling on rpi3 work (and other armv7 cpus) --- pCloudCC/lib/mbedtls/CMakeLists.txt | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pCloudCC/lib/mbedtls/CMakeLists.txt b/pCloudCC/lib/mbedtls/CMakeLists.txt index eafe3017..420dff41 100644 --- a/pCloudCC/lib/mbedtls/CMakeLists.txt +++ b/pCloudCC/lib/mbedtls/CMakeLists.txt @@ -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") @@ -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") From fdd1d09a6f10bf5b9dbef8c38c79485733dbd885 Mon Sep 17 00:00:00 2001 From: Gordin <9ordin@gmail.com> Date: Sat, 18 May 2019 02:00:26 +0200 Subject: [PATCH 3/8] Adds missing dependency in README.md --- README.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 7cae5772..99665f5e 100644 --- a/README.md +++ b/README.md @@ -12,11 +12,11 @@ Also requires [CMake](https://cmake.org/) build system. On Ubuntu you can run the following command: -> sudo apt-get install cmake zlib1g-dev libboost-system-dev libboost-program-options-dev libpthread-stubs0-dev libfuse-dev +> sudo apt-get install cmake zlib1g-dev libboost-system-dev libboost-program-options-dev libpthread-stubs0-dev libfuse-dev libudev-dev ## Build steps -> sudo apt-get install cmake zlib1g-dev libboost-system-dev libboost-program-options-dev libpthread-stubs0-dev libfuse-dev git +> 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/ From 8091f3b017c5b778aceffeaea493ab74a370a0d0 Mon Sep 17 00:00:00 2001 From: Gordin <9ordin@gmail.com> Date: Sat, 18 May 2019 02:00:44 +0200 Subject: [PATCH 4/8] Ignores files that are created by cmake/make --- .gitignore | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/.gitignore b/.gitignore index e0292b19..fcf9a284 100644 --- a/.gitignore +++ b/.gitignore @@ -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 From e04f5a0bd79300feae249fa764b5f29100d74ad9 Mon Sep 17 00:00:00 2001 From: Gordin <9ordin@gmail.com> Date: Sat, 18 May 2019 02:01:06 +0200 Subject: [PATCH 5/8] Adds install shell script for debian based distros --- install_debian.sh | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) create mode 100755 install_debian.sh diff --git a/install_debian.sh b/install_debian.sh new file mode 100755 index 00000000..623991cf --- /dev/null +++ b/install_debian.sh @@ -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 From 623565f379db9c480532e389021ae75b1ed2e75d Mon Sep 17 00:00:00 2001 From: Gordin <9ordin@gmail.com> Date: Mon, 27 May 2019 19:09:43 +0200 Subject: [PATCH 6/8] Fixes big cache and README --- README.md | 30 +++++++++++++++--------------- install_debian.sh | 32 ++++++++++++++++---------------- pCloudCC/lib/pclsync/psettings.h | 2 +- 3 files changed, 32 insertions(+), 32 deletions(-) diff --git a/README.md b/README.md index 99665f5e..5ad8198e 100644 --- a/README.md +++ b/README.md @@ -16,23 +16,23 @@ On Ubuntu you can run the following command: ## Build steps -> sudo apt-get install cmake zlib1g-dev libboost-system-dev libboost-program-options-dev libpthread-stubs0-dev libfuse-dev libudev-dev git +> 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 -> pcloudcc -u username -p +> cd ./console-client/pCloudCC/ +> cd lib/pclsync/ +> make clean +> make fs +> cd ../mbedtls/ +> cmake . +> make clean +> make +> cd ../.. +> cmake . +> make +> sudo make install +> ldconfig +> pcloudcc -u username -p ## Usage Terminal command is pcloudcc and -h option prints short options description. diff --git a/install_debian.sh b/install_debian.sh index 623991cf..5e94e261 100755 --- a/install_debian.sh +++ b/install_debian.sh @@ -1,17 +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 +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 diff --git a/pCloudCC/lib/pclsync/psettings.h b/pCloudCC/lib/pclsync/psettings.h index 71fb8f24..ff67970e 100644 --- a/pCloudCC/lib/pclsync/psettings.h +++ b/pCloudCC/lib/pclsync/psettings.h @@ -233,7 +233,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 From c950c21cec216b66f890ee64f60cc3c0b37cf4f8 Mon Sep 17 00:00:00 2001 From: Joe Wolfgram Date: Fri, 14 Jan 2022 23:30:31 -0500 Subject: [PATCH 7/8] FIxing MAKEFILE to not care about optimizaation to build ARM --- pCloudCC/lib/pclsync/Makefile | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/pCloudCC/lib/pclsync/Makefile b/pCloudCC/lib/pclsync/Makefile index ffb86385..ede5d878 100644 --- a/pCloudCC/lib/pclsync/Makefile +++ b/pCloudCC/lib/pclsync/Makefile @@ -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 From 733fcb4ea61b7275cc780571617044dd4eb8298a Mon Sep 17 00:00:00 2001 From: Joe Wolfgram Date: Fri, 14 Jan 2022 23:35:38 -0500 Subject: [PATCH 8/8] Fix: opt to allow fuse to mount for all users to R/W (use with caution) --- pCloudCC/lib/pclsync/pfs.c | 1 + 1 file changed, 1 insertion(+) diff --git a/pCloudCC/lib/pclsync/pfs.c b/pCloudCC/lib/pclsync/pfs.c index 165c0856..814adfc9 100644 --- a/pCloudCC/lib/pclsync/pfs.c +++ b/pCloudCC/lib/pclsync/pfs.c @@ -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()) {