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

mips32r2_common: Update thread_arch for compatibility with newer toolchains #10009

Closed
wants to merge 3 commits into from

Conversation

jnohlgard
Copy link
Member

Contribution description

This should fix the build issue described in RIOT-OS/riotdocker#47

Testing procedure

Install a new version of the mips-mti-elf toolchain, or use the proposed Docker image in RIOT-OS/riotdocker#47
Run some test applications on actual hardware (e.g. pic32-clicker or pic32-wifire)

Issues/PRs references

RIOT-OS/riotdocker#47

@jnohlgard jnohlgard added Type: bug The issue reports a bug / The PR fixes a bug (including spelling errors) CI: ready for build If set, CI server will compile all applications for all available boards for the labeled PR Platform: MIPS Platform: This PR/issue effects MIPS-based platforms labels Sep 21, 2018
@jnohlgard jnohlgard added this to the Release 2018.10 milestone Sep 21, 2018
@jnohlgard jnohlgard requested a review from cladmi September 21, 2018 07:32
@cladmi cladmi self-assigned this Sep 21, 2018
@cladmi
Copy link
Contributor

cladmi commented Sep 21, 2018

On ubuntu 16.04 it fixes the first issue with the new mips toolchain but I have the new following one with pic32-wifire at least (the one I have to test):

objcopy: RIOT/examples/hello-world/bin/pic32-wifire/hello-world.hex: address 0xffffffff1d000000 out of range for Intel Hex file

I will try with the updated docker image as I do not have the issue on arch linux.

@jnohlgard
Copy link
Member Author

I get that error too on my machine, but not in the docker image.

@cladmi
Copy link
Contributor

cladmi commented Sep 21, 2018

It's strange because the objcopy version is the same…

@jnohlgard
Copy link
Member Author

@cladmi did you test with the new Docker image?

@cladmi
Copy link
Contributor

cladmi commented Sep 30, 2018

I tried and I think I did not have issues, I should verify tomorrow on the other laptop.
Also wanted to maybe start doing loaded libraries debugging or strace things to find whiy.

However I also still need to test an error path that triggers _mips_handle_exception.

If the code works but we still get the objdump issue, it could still go in I think as it does not change any behavior on the current mips version, but would just need another round of tests before saying the mips link should be updated now and deployed on murdock.

It's however in my priority list to have a working docker image.

@cladmi cladmi requested a review from neiljay October 1, 2018 15:55
@@ -35,6 +35,10 @@
#define MM_SYSCALL (0x8B7C0000)
#define MM_SYSCALL_MASK (0xfffffc00)

/* For backwards compatibility with mips-mti-elf toolchain release 2016.05-03 */
#if !defined(_MIPS_HAL_NOMIPS16)
#define _MIPS_HAL_NOMIPS16 __attribute__((nomips16))
Copy link
Contributor

@cladmi cladmi Oct 1, 2018

Choose a reason for hiding this comment

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

Maybe put in the header commit message that it is defined in mips/hal.h

@cladmi
Copy link
Contributor

cladmi commented Oct 1, 2018

It compiles for all three mips boards with the RIOT-OS/riotdocker#47 docker image

I did not have time to test today, will be on thursday.

@cladmi
Copy link
Contributor

cladmi commented Oct 5, 2018

The difference I have between the ubuntu 16.04 and the docker container is the libbfd version used by objcopy.

ubuntu16.04$ ldd $(which objcopy)
        linux-vdso.so.1 =>  (0x00007ffcf1b37000)
        libbfd-2.26.1-multiarch.so => /usr/lib/x86_64-linux-gnu/libbfd-2.26.1-multiarch.so (0x00007f7d6f8dc000)
        libc.so.6 => /lib/x86_64-linux-gnu/libc.so.6 (0x00007f7d6f512000)
        libz.so.1 => /lib/x86_64-linux-gnu/libz.so.1 (0x00007f7d6f2f8000)
        libdl.so.2 => /lib/x86_64-linux-gnu/libdl.so.2 (0x00007f7d6f0f4000)
        /lib64/ld-linux-x86-64.so.2 (0x00007f7d6fe3c000)
root@docker_pr47:~# ldd $(which objcopy)                                                                                              
        linux-vdso.so.1 =>  (0x00007fff4535a000)
        libbfd-2.26.1-system.so => /usr/lib/x86_64-linux-gnu/libbfd-2.26.1-system.so (0x00007fb6fb1a3000)
        libc.so.6 => /lib/x86_64-linux-gnu/libc.so.6 (0x00007fb6fadd9000)
        libz.so.1 => /lib/x86_64-linux-gnu/libz.so.1 (0x00007fb6fabbf000)
        libdl.so.2 => /lib/x86_64-linux-gnu/libdl.so.2 (0x00007fb6fa9bb000)
        /lib64/ld-linux-x86-64.so.2 (0x00007fb6fb4e8000)

If I try running with the non multiarch version it works:

LD_PRELOAD=/usr/lib/x86_64-linux-gnu/libbfd-2.26.1-system.so objcopy ...

@cladmi
Copy link
Contributor

cladmi commented Oct 5, 2018

But it also fails with mips-mti-elf-objcopy so could still be showing an error in a linker script or a new configuration that should be set.

@cladmi
Copy link
Contributor

cladmi commented Oct 5, 2018

There is a reference here but not helping much http://forum.pinguino.cc/showthread.php?tid=3267

@cladmi
Copy link
Contributor

cladmi commented Oct 5, 2018

It was also already mentioned by @aabadie in RIOT-OS/Release-Specs#44 (comment)

@jnohlgard jnohlgard force-pushed the pr/mips-nomips16-attr branch from eb6beec to 5f88385 Compare November 1, 2018 10:21
@jnohlgard
Copy link
Member Author

Rebased, added code comment about why we need the macro in the older toolchains.

@miri64 miri64 removed this from the Release 2019.04 milestone May 7, 2019
@miri64 miri64 added this to the Release 2019.07 milestone May 7, 2019
@benpicco
Copy link
Contributor

I suppose this was superseded by #11986 and can now be closed?

@kaspar030
Copy link
Contributor

I suppose this was superseded by #11986 and can now be closed?

Aaah, I wasn't aware of this. Sorry @gebart!

Yeah, this is obsolete.

@kaspar030 kaspar030 closed this Sep 23, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
CI: ready for build If set, CI server will compile all applications for all available boards for the labeled PR Platform: MIPS Platform: This PR/issue effects MIPS-based platforms Type: bug The issue reports a bug / The PR fixes a bug (including spelling errors)
Projects
None yet
Development

Successfully merging this pull request may close these issues.

8 participants