Coder Social home page Coder Social logo

Fixes to compile for Raspbian (Pi) about bitc HOT 10 CLOSED

bit-c avatar bit-c commented on June 13, 2024
Fixes to compile for Raspbian (Pi)

from bitc.

Comments (10)

mx4 avatar mx4 commented on June 13, 2024

It seems that the CFLAGS addition were due to you using a crosscompiler, however I'll look to incorporating the PATH_MAX & sscanf fixes. Thanks!

from bitc.

mx4 avatar mx4 commented on June 13, 2024

On second thought, file.h already #include's <linux/limits.h> to pull PATH_MAX's definition and all the files using PATH_MAX also #include file.h:

[u@foo git/bitc/src]$ grep PATH_MAX *
addrbook.c: char path[PATH_MAX];
block-store.c: char bsPath[PATH_MAX];
file.c: char file0[PATH_MAX];
file.c: char file1[PATH_MAX];
file.h:// PATH_MAX
txdb.c: char txdbPath[PATH_MAX];
util.c: char filePath[PATH_MAX];
[u@foo git/bitc/src]$ grep file.h *
addrbook.c:#include "file.h"
block-store.c:#include "file.h"
config.c:#include "file.h"
file.c:#include "file.h"
main.c:#include "file.h"
txdb.c:#include "file.h"
util.c:#include "file.h"
wallet.c:#include "file.h"

So it's not clear that #including <linux/limits.h> in these files will help.

Also the problem related to ___isoc99_sscanf appears to be due to the use of a non-standard library, so I'm tempted to just punt on this bug.

Note that I've had a report from a bitcointalk user that bitc was compiling & running great on a raspberry pi running raspbian 7.2. So this looks like an issue with your environment.

from bitc.

SnowLeopard71 avatar SnowLeopard71 commented on June 13, 2024

What user on bitcointalk?
It does not compile cleanly on a fully updated raspbian 7.2, I just tried again.
If I change 'CC = clang' to 'CC = gcc', it still fails:

 $ make
 CC    src/MurmurHash3.c
 CC    src/addrbook.c
 CC    src/base58.c
 CC    src/bitc_ui.c
 CC    src/block-store.c
 CC    src/bloom.c
 CC    src/btc-message.c
 CC    src/cJSON.c
 CC    src/config.c
 CC    src/crypt.c
 CC    src/file.c
 CC    src/fx.c
 CC    src/hash.c
 CC    src/hashtable.c
 CC    src/ip_info.c
 CC    src/key.c
 CC    src/main.c
src/main.c: In function âmainâ:
src/main.c:1164:9: error: declaration of âgetpassâ shadows a global declaration [-Werror=shadow]
cc1: all warnings being treated as errors
make: *** [bld/main.o] Error 1

from bitc.

mx4 avatar mx4 commented on June 13, 2024

This was user "fronti".

What happens if you rename all usages of the variable 'getpass' to 'getpassword'? Does this compile fine? If not, can you give me ssh access to your raspberry pi?

from bitc.

SnowLeopard71 avatar SnowLeopard71 commented on June 13, 2024

Problem appears to be clang on Pi. The results above included the CFLAGS that you said to comment out.
Here's an attempt at patching the Makefile to use gcc when on a Pi:

--- bitc.1/Makefile     2014-02-21 13:43:59.103515150 -0500
+++ bitc/Makefile       2014-02-25 15:37:24.718274495 -0500
@@ -1,7 +1,13 @@

 OS=$(shell uname -s)
+MACH=$(shell uname -m)

+ifeq ($(MACH), armv6l)
+CC = gcc
+else
 CC = clang
+endif
+
 ASAN = 0

 ###
@@ -9,8 +15,10 @@
 ###

 CFLAGS  = -O1 -MMD -g
+ifeq ($(CC), clang)
 CFLAGS += -Wall -Werror -Wshadow
 CFLAGS += -Wextra -Wno-unused-parameter -Wno-sign-compare -Wno-missing-field-initializers
+endif

 CFLAGS += -fno-omit-frame-pointer
 CFLAGS += -fstack-protector

from bitc.

SnowLeopard71 avatar SnowLeopard71 commented on June 13, 2024

Actually, -Wall -Werror can be left in, it's only -Wgshadow that is a problem.
(Please forgive my noobness).

from bitc.

mx4 avatar mx4 commented on June 13, 2024

Should be fixed-up now. Can you please git pull, then make and let me know how that goes? Thanks.

from bitc.

SnowLeopard71 avatar SnowLeopard71 commented on June 13, 2024

Nope... ARCH vs MACH as variable not selecting compiler right, and it only compiles after removing -Wgshadow -Wextra
The errors those flags give:
src/poll.c:75:53: error: declaration of âpollâ shadows a global declaration [-Werror=shadow]
src/poll.c:200:4: error: comparison is always true due to limited range of data type [-Werror=type-limits]

from bitc.

mx4 avatar mx4 commented on June 13, 2024

Yes, sorry about that. What about now?

from bitc.

SnowLeopard71 avatar SnowLeopard71 commented on June 13, 2024

That did it! Nice clean compile :)
Took maybe 2 minutes to startup and get to 'online'.
Now this issues just needs to be marked "fixed" instead of "won't fix" :)
Thanks!

from bitc.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.