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

Desmume: fix gcc6 #28667

Closed
wants to merge 1 commit into from
Closed

Desmume: fix gcc6 #28667

wants to merge 1 commit into from

Conversation

AndersonTorres
Copy link
Member

@AndersonTorres AndersonTorres commented Aug 29, 2017

Fix a gcc6 compilation problem

Motivation for this change

Fix Hydra failure described in #28643

Applying a patch by Debian developers to fix a GCC6 problem.

Things done
  • Tested using sandboxing
    (nix.useSandbox on NixOS,
    or option build-use-sandbox in nix.conf
    on non-NixOS)
  • Built on platform(s)
    • NixOS
    • macOS
    • Linux
  • Tested via one or more NixOS test(s) if existing and applicable for the change (look inside nixos/tests)
  • Tested compilation of all pkgs that depend on this change using nix-shell -p nox --run "nox-review wip"
  • Tested execution of all binary files (usually in ./result/bin/)
  • Fits CONTRIBUTING.md.

Additional reminder: a experimental "github" version is also available, but marked as "broken" because of desmume gtk bug,.

@mention-bot
Copy link

@AndersonTorres, thanks for your PR! By analyzing the history of the files in this pull request, we identified @vcunat and @zimbatm to be potential reviewers.

@Mic92
Copy link
Member

Mic92 commented Aug 29, 2017

I get the following build error on nixpkgs master:

In file included from armcpu.cpp:32:0:
MMU_timing.h: In instantiation of 'class CacheController<13, 2, 5>':
MMU_timing.h:253:26:   required from here
MMU_timing.h:158:28: error: left operand of shift expression '(-1 << 11)' is negative [-fpermissive]
  enum { TAGMASK = (u32)(~0 << TAGSHIFT) };
                        ~~~~^~~~~~~~~~~~
MMU_timing.h:158:7: error: enumerator value for 'TAGMASK' is not an integer constant
  enum { TAGMASK = (u32)(~0 << TAGSHIFT) };
       ^
MMU_timing.h:159:61: error: left operand of shift expression '(-1 << 5)' is negative [-fpermissive]
  enum { BLOCKMASK = ((u32)~0 >> (32 - TAGSHIFT)) & (u32)(~0 << BLOCKSIZESHIFT) };
                                                         ~~~~^~~~~~~~~~~~~~~~~~
MMU_timing.h:159:7: error: enumerator value for 'BLOCKMASK' is not an integer constant
  enum { BLOCKMASK = ((u32)~0 >> (32 - TAGSHIFT)) & (u32)(~0 << BLOCKSIZESHIFT) };
       ^
MMU_timing.h: In instantiation of 'class CacheController<12, 2, 5>':
MMU_timing.h:254:26:   required from here
MMU_timing.h:158:28: error: left operand of shift expression '(-1 << 10)' is negative [-fpermissive]
  enum { TAGMASK = (u32)(~0 << TAGSHIFT) };
                        ~~~~^~~~~~~~~~~~
MMU_timing.h:158:7: error: enumerator value for 'TAGMASK' is not an integer constant
  enum { TAGMASK = (u32)(~0 << TAGSHIFT) };
       ^
MMU_timing.h:159:61: error: left operand of shift expression '(-1 << 5)' is negative [-fpermissive]
  enum { BLOCKMASK = ((u32)~0 >> (32 - TAGSHIFT)) & (u32)(~0 << BLOCKSIZESHIFT) };
                                                         ~~~~^~~~~~~~~~~~~~~~~~
MMU_timing.h:159:7: error: enumerator value for 'BLOCKMASK' is not an integer constant
  enum { BLOCKMASK = ((u32)~0 >> (32 - TAGSHIFT)) & (u32)(~0 << BLOCKSIZESHIFT) };
       ^
make[2]: *** [Makefile:1205: armcpu.o] Error 1
make[2]: Leaving directory '/tmp/nix-build-desmume-0.9.11.drv-0/desmume-0.9.11/src'
make[1]: *** [Makefile:1222: all-recursive] Error 1
make[1]: Leaving directory '/tmp/nix-build-desmume-0.9.11.drv-0/desmume-0.9.11/src'
make: *** [Makefile:350: all-recursive] Error 1
builder for ‘/nix/store/vwsp68cpgfyfyn576pyqmbcc9w9cdcp7-desmume-0.9.11.drv’ failed with exit code 2
error: build of ‘/nix/store/vwsp68cpgfyfyn576pyqmbcc9w9cdcp7-desmume-0.9.11.drv’ failed
/run/current-system/sw/bin/nix-shell: failed to build all dependencies
The invocation of "nix-shell --keep-going -j4 --option build-use-sandbox true -p desmume" failed

@AndersonTorres
Copy link
Member Author

It is a bug triggered by GCC6. I found this:

https://sourceforge.net/p/desmume/bugs/1570/

Maybe the best way is to use the github repository code (https://github.com/TASVideos/desmume).

@fpletz fpletz added this to the 17.09 milestone Aug 30, 2017
@AndersonTorres
Copy link
Member Author

It becomes worse: it compiles in master but doesn't run (SIGSEGV).

@AndersonTorres AndersonTorres changed the title Desmume: enable Glade Desmume: 0.9.11 -> 2017-09-01 Sep 2, 2017
@7c6f434c
Copy link
Member

7c6f434c commented Sep 3, 2017

Maybe call it something containing 0.9.11 so that 0.10 is later recongnized as a fresher version? (also, does it work now?)

@AndersonTorres
Copy link
Member Author

It isn't working.

Are you suggesting I change the name for something like 0.9.11-git-2017-09-01?

@7c6f434c
Copy link
Member

7c6f434c commented Sep 3, 2017

Yes, something like that. Should the PR be renamed as [WIP] until the update works?

@AndersonTorres AndersonTorres changed the title Desmume: 0.9.11 -> 2017-09-01 Desmume: 0.9.11 -> 0.9.11-git-2017-09-01 [WIP] Sep 4, 2017
@AndersonTorres
Copy link
Member Author

As I have written in TODO lines: it runs but with caveats. In my machine, only the binary desmume-glade runs nicely, the others just SIGSEGV. I think it is just a huge bug in the upstream code.

At least one (and only one) binary is usable, then I think we can add it.

@7c6f434c
Copy link
Member

7c6f434c commented Sep 8, 2017

I wonder if 0.9.11 behaved the same way (before the GCC update)

@AndersonTorres AndersonTorres changed the title Desmume: 0.9.11 -> 0.9.11-git-2017-09-01 [WIP] Desmume: 0.9.11 -> 0.9.11-git-2017-09-01 Sep 8, 2017
@AndersonTorres AndersonTorres changed the title Desmume: 0.9.11 -> 0.9.11-git-2017-09-01 Desmume: 0.9.11 -> 0.9.11-git-2017-09-01 Sep 8, 2017
@AndersonTorres
Copy link
Member Author

AndersonTorres commented Sep 16, 2017

The patch doesn't run in this git version; I think they already have fixed the gcc6 issue in github.

@AndersonTorres AndersonTorres changed the title Desmume: 0.9.11 -> 0.9.11-git-2017-09-01 Desmume: fix gcc6 Sep 16, 2017
@AndersonTorres
Copy link
Member Author

AndersonTorres commented Sep 16, 2017

@7c6f434c I have reversed and applied the patch to the old version.

@7c6f434c
Copy link
Member

Currently GitHub shows no addition of patches in default.nix. Also, git snapshot version lost its 0.9.11-git- prefix to version

And also, add a git version (not working fully)
@AndersonTorres
Copy link
Member Author

This was because the debian patch was applied by @markus2342, not by me.

I will fix the 'version tag'.

@AndersonTorres
Copy link
Member Author

As the main problem was solved elsewhere, it has not much sense to maintain it. I will close it.

@AndersonTorres AndersonTorres deleted the upload-desmume branch February 23, 2018 01:25
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

5 participants