Announcement

Collapse
No announcement yet.

GCC Developers Discuss New Option For Recording Compiler Flags / Details In Binaries

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • GCC Developers Discuss New Option For Recording Compiler Flags / Details In Binaries

    Phoronix: GCC Developers Discuss New Option For Recording Compiler Flags / Details In Binaries

    GCC developers recently have been discussing a new proposal over an option for preserving the command-line flags/options used when building a binary as well as the associated compiler version...

    Phoronix, Linux Hardware Reviews, Linux hardware benchmarks, Linux server benchmarks, Linux benchmarking, Desktop Linux, Linux performance, Open Source graphics, Linux How To, Ubuntu benchmarks, Ubuntu hardware, Phoronix Test Suite

  • #2
    This looks to me similar to how x265 records the encoding flags in the resulting media file which can be seen afterwards with a tool like MediaInfo.
    This is quite cool and very helpful for a lot of reasons. I hope they will go ahead with this.

    Comment


    • #3
      x264 has been doing that for ages.

      I like the proposal a lot, however there's one huge caveat: some distros patch GCC yet the version string remains the same, so the flags and version alone won't help you rebuild the same binary.

      Comment


      • #4
        would love to see this option in GCC !

        Comment


        • #5
          I’d rather see this down external to the compiler. Now I haven’t thought a great deal about it but a standard lib that developers can choose to include would be one option.

          the problem, with C anyways is binary size. Sometimes you simply don’t want to waste the space. Especially when you consider the size of the environment you need to include to truly get all the info to make the whole thing useful.

          Comment


          • #6
            Originally posted by wizard69 View Post
            I’d rather see this down external to the compiler. Now I haven’t thought a great deal about it but a standard lib that developers can choose to include would be one option.

            the problem, with C anyways is binary size. Sometimes you simply don’t want to waste the space. Especially when you consider the size of the environment you need to include to truly get all the info to make the whole thing useful.
            What. Are. You. Talking. About? GCC has embedded its own version in all binaries/libraries for as long as I remember and no one has ever complained.

            The compilation flags consume less than two hundred bytes while the smallest library on my x86-64 system weighs 15KiB. We're talking at most a 2% increase in a binary size while overall it should be a lot less, since the average size of my library on my Fedora 31 installation is staggering 1171KiB (874 libraries which weigh in at roughly 1GB) so we are talking of less than a 0.02% increase in size.

            What you're saying could have mattered in ... the early 90s I guess? Even though no one back then used anything rather than -O2/-O3, so it was just four freaking bytes (along with a terminating \0). GCC didn't even support -march/-mtune in the past.

            While I was writing this another issue came up in my mind: -mtune=native depends on your host CPU parameters (cache, arch, supported features, etc.) and that would be somewhat tricky to embed though not impossible.

            Comment


            • #7
              Originally posted by Danny3 View Post
              This looks to me similar to how x265 records the encoding flags in the resulting media file which can be seen afterwards with a tool like MediaInfo.
              This is quite cool and very helpful for a lot of reasons. I hope they will go ahead with this.
              I'm pretty sure MAFIAA would appreciate that. Even better, put CPU and HDD serial # here, so that pesky pirate releasers tracked down to very exact computer, that can be used as proof in court. Leaking just system information and favorite encoding options could be not enough to fully identify person & computer.

              Comment


              • #8
                Like the FileZilla about dialog.

                Comment


                • #9
                  Originally posted by SystemCrasher View Post
                  I'm pretty sure MAFIAA would appreciate that. Even better, put CPU and HDD serial # here, so that pesky pirate releasers tracked down to very exact computer, that can be used as proof in court. Leaking just system information and favorite encoding options could be not enough to fully identify person & computer.
                  Are you stupid? How is recording the encoding settings used to generate a file related in any way to piracy or privacy.

                  Comment


                  • #10
                    Originally posted by uid313 View Post
                    Like the FileZilla about dialog.
                    Umm. That does mean that FileZilla recorded the compiletime switches in the binaries.
                    It could have been stored in a file although I agree that it's trivial to stick it into a binary.

                    Comment

                    Working...
                    X