Skip to content

Conversation

@leonmak
Copy link

@leonmak leonmak commented Dec 5, 2017

Adds armv7 to compile on 32bit Raspian OS.
I'm not very sure how to properly check in bash but added an ifneq statement, do suggest but I'm just offering a makeshift solution for now.


CC=gcc
CFLAGS=-fPIC -O3 -fomit-frame-pointer -fno-exceptions -Wall -std=c99 -pedantic
MODEL=$(cat /proc/device-tree/model)
Copy link
Owner

@xadhoom xadhoom Dec 6, 2017

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this will fail on standard system and no error handling is done

MODEL=$(cat /proc/device-tree/model)
ifeq (${PROC},x86_64)
CFLAGS+=-m64 -mtune=generic
else ifneq (,$(findstring "Raspberry Pi", $(MODEL)))
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I would check the PROC var, or at least leverage on uname:

pi@raspberrypi:~ $ uname -a
Linux raspberrypi 4.1.19-v7+ #858 SMP Tue Mar 15 15:56:00 GMT 2016 armv7l GNU/Linux

I don't have a rpi now to check what uname -m outputs (basically the value of $PROC), you may want to look at it.

Right now (without your mods), what happens?

Copy link
Author

@leonmak leonmak Dec 7, 2017

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

gcc: error: unrecognized argument in option ‘-march=i686’
gcc: error: unrecognized command line option ‘-m32’

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ok , uname -m return armv7l

Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ok, so please update the PR (and rebase it to have a single commit) and I'll be happy to check it again and merge!

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is pretty much a duplicate of my pr #19
Adding that specific raspberry pi code is not needed afaik.

Just need to eliminate the usage of m32 etc from non x86 based architectures like arm etc.

Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@leonmak I just merged @MartB #19 , could you give it a shot and check if this can be closed?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants