Giter Site home page Giter Site logo

Comments (5)

pauloscustodio avatar pauloscustodio commented on May 18, 2024

from: Paulo Custodio [email protected]
to: "alvin ([email protected])" [email protected]
cc: z88dk dev [email protected]
date: Sun, Oct 23, 2016 at 4:51 PM

The line you refer was recently introduced to support the consolidated object file; the -o option for naming the binary is used to name the consolidated object, which is produced at the link phase by reading all the object files from the input assembly files.

As z80asm does process a list of asm files in one go, e.g. to link a binary or build a library, the object file has to be determined from the source name.

The problem you mention: could it be solved by passing an extra -I option to z80asm with the original source directory of the source?

from z88dk.

pauloscustodio avatar pauloscustodio commented on May 18, 2024

from: alvin ([email protected]) [email protected] via lists.sourceforge.net
to: [email protected]
date: Sun, Oct 23, 2016 at 11:21 PM

Line 39 of options_def.h hints that this was considered but never implemented:
OPT_VAR( char , consol_obj_file, NULL) / set by -o and no -b */
The line you refer was recently introduced to support the consolidated object file; the -o option for naming the binary is used to name the consolidated object, which is produced at the link phase by reading all the object files from the input assembly files.
As z80asm does process a list of asm files in one go, e.g. to link a binary or build a library, the object file has to be determined from the source name.
Another possibility is to distinguish between two cases: if there is only one source file use the output filename. If there are many source files, ignore the output filename. Except for the consolidated object, libraries and binaries which are intended to combine many files into one.

The problem you mention: could it be solved by passing an extra -I option to z80asm with the original source directory of the source?
For now, zcc is copying .asm files to the temp dir before assembling so the .o is created in the temp dir. The include path will not resolve properly if the .asm file was not originally sitting in the cwd but nobody's complained about this in the last decade at least :P

But yes that can be done. There is a second issue with this where we've already created the include path string that is properly sequenced in the order the user wants. So adding a new include path at the point of assembling won't necessarily honour that sequence without some other changes.

from z88dk.

aralbrec avatar aralbrec commented on May 18, 2024

The suggested solution was applied in zcc, that is the user's asm file is copied to the temp directory and then is assembled to object file with the path to the original location added at the end of z80asm's include path list.

But as you say, this may mess with the user's intended path search order.

from z88dk.

pauloscustodio avatar pauloscustodio commented on May 18, 2024

The current z80asm also has already this solution in place: the directory of the main assembly file, i.e. the one mentioned in the command line, is appended to the end of include path before parsing the file and removed afterwards. This allows relative include paths out-of-the-box.

from z88dk.

pauloscustodio avatar pauloscustodio commented on May 18, 2024

Issue solved with the introduction of consolidated object files:

z88dk-z80asm -Otest.dir -ozcc0000.o test.asm

-Otest.dir creates all object files in that directory.
-ozcc0000.o creates a consolidated object file containing the test.o object also in the test.dir directory.

from z88dk.

Related Issues (20)

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.