Giter VIP home page Giter VIP logo

Comments (3)

ryanphuang avatar ryanphuang commented on August 19, 2024 1

Sorry for not getting back to you on this sooner. I'm glad it worked for you now :) And thanks for sharing your experience. I'll update the documentation to note this.

from pintosm.

ryanphuang avatar ryanphuang commented on August 19, 2024 1

I just had access to a Ubuntu 18.04 machine and can confirm this issue. It's likely due to some recent changes in gcc 7 (or binutils) that break the global static struct initialization in cross-compilation. The resulted object file does not have the appropriate data segment:

$ objdump -j.data -s build/lib/stdio.o

build/lib/stdio.o:     file format elf32-i386

Whereas on a working toolchain, the object file should have the data segment present:

$ objdump -j.data -s build/lib/stdio.o

build/lib/stdio.o:     file format elf32-i386

Contents of section .data:
 0000 6a000000 70000000 73000000 76000000  j...p...s...v...
 0010 79000000 00000000                    y.......

It looks like the const char * field is the culprit. If you change it to char array, e.g., char [16], it would work. But then you would soon hit the same issue at other places that use char * in struct.

I haven't been able to track down the exact "bug" or flag in GCC 7 that causes this. For now, building the i386 toolchain is the best way for Ubuntu 18.04. Ubuntu 16.04 with the stock GCC 5 does not have this issue.

from pintosm.

cgbahk avatar cgbahk commented on August 19, 2024

The reason of the symptom is that I was not using recommended toolchain i386-elf-* 😂

BTW I had to give CXXFLAGS = '-fpermissive' and install apt install libncurses5-dev for toolchain auto build script to run without error. It was from ubuntu 18.04 & g++ 7.4.0.

from pintosm.

Related Issues (1)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.