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

Arch linux (and others?) workaround for global variables defined multiple times in different files #43

Open
RTimothyEdwards opened this issue Jun 27, 2020 · 6 comments

Comments

@RTimothyEdwards
Copy link
Contributor

At least in Arch linux, and probably others, the linker stage fails because gcc is configured to define "-fno-common" by default, and so it becomes illegal to declare a global variable of the same name in more than one C file that are going to be linked into the same object file.

The workaround is to add

set(CMAKE_C_FLAGS "-fcommon")
set(CMAKE_CXX_FLAGS "-fcommon")

to CMakeLists.txt.

The real fix would be to set -fno-common to force the compiler error and then fix all the instances where global variables have been defined more than once in files being linked together.

---Tim

@belohoub
Copy link

I confirm, that this is an issue in the last Fedora release (32)

@barrya0
Copy link

barrya0 commented Aug 23, 2024

Hello, I am trying to make this change in CMakeLists.txt but i keep getting the notice "media is write protected". You guys know of anyway to get around this. I've tried running my editor in administrator mode and changing the property of CMakeLists to no avail

@belohoub
Copy link

Hello,
I just tested to build on Debian stable, and the workaround above works fine.
You have probably an issue with your disk, or media where your graywolf directory is located. This should have nothing to do with graywolf.

Check the location where you cloned/decompressed graywolf, then you probably need to check why is your disk mounted read-only, and you can try something like "mount -o remount,rw /path".

@barrya0
Copy link

barrya0 commented Aug 23, 2024

Hello again,

Still scratching my head. I'm cloning graywolf to "\wsl.localhost\Ubuntu\mnt\wslg\distro\root"

I'm also running my ubuntu terminal as administrator.
Running the "mount |grep "/ type" " command output

"/dev/sdc on / type ext4 (rw,relatime,discard,errors=remount-ro,data=ordered)"

I'm not sure what this means for me but I ran the "mount -o remount,rw /path" command anyways. I'm still not able to change the txt file. I understand if I can't receive further help from here. I just would like to use Qflow so I need to fix this. Should I not be cloning to this location?

@barrya0
Copy link

barrya0 commented Aug 23, 2024

Okay so I just moved the location to my home directory and I was able to install it just fine with that fix. Little bit silly from me but thank you for pointing out it was a problem with the location.

@belohoub
Copy link

belohoub commented Aug 26, 2024

Well, WSL is a special layer in Windows allowing Linux kernel execution. depending on what and how you installed the distro, it could add an additional complexity.

I'm not a WSL user, but according to the path, it looks like you were trying to clone to the root filesystem. It is commonly not a good idea. It could be somehow protected. Some systems could even distribute root fs as non-writable image e.g. to manage atomic updates or any kind of stuff. It depends, Linux could be a very diverse environment.

Home directory of a regular user is always the place where similar stuff should be done.

But there are standards, and if you enter VLSI design, you should (if you are not yet) get familiar with Unix standards and tools such as POSIX and bash (minimum + grep, sed, awk, ...), as not only open VLSI tools, but also the majority of commercial tools normally run on Linux, not Windows (yes, there are many Linux-only tools in this domain).

"mount -o remount,rw /path" was only an example "path" should be replaced by path to the device or mountpoint. This command will re-mount device to read-write if it is read-only.

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

No branches or pull requests

3 participants