-
Notifications
You must be signed in to change notification settings - Fork 36
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
Comments
I confirm, that this is an issue in the last Fedora release (32) |
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 |
Hello, 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". |
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. "/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? |
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. |
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. |
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
The text was updated successfully, but these errors were encountered: