Author Topic: binutils, what is /share/locale/uk/LC_MESSAGES/bfd.mo for?  (Read 1423 times)

0 Members and 1 Guest are viewing this topic.

Offline legacyTopic starter

  • Super Contributor
  • ***
  • !
  • Posts: 4415
  • Country: ch
binutils, what is /share/locale/uk/LC_MESSAGES/bfd.mo for?
« on: February 03, 2019, 06:29:40 pm »
so I am trying to create an overlay for Gentoo with a simple folder schema:

Code: [Select]
lsp /usr/idp/
        F /usr/idp/bin
        F /usr/idp/m68hc11-elf
        F /usr/idp/riscv32-unknown-elf
        F /usr/idp/share

as you can see binaries go into /usr/idp/bin, while specific files go to the $target folder
but I also have a "share" folder, which contains

Code: [Select]
lsp /usr/idp/share
        F /usr/idp/share/info
        F /usr/idp/share/locale
        F /usr/idp/share/man

and /share/locale/uk/LC_MESSAGES contains a lot of .mo files, e.g. bfd.mo
what is it useful for?

I have to care about "collisions", because if I emerge a toolchain there are files with the same filename that collide into the same and /share/locale/uk/LC_MESSAGES folder

This is no good for how Gentoo works.
 

Offline legacyTopic starter

  • Super Contributor
  • ***
  • !
  • Posts: 4415
  • Country: ch
Re: binutils, what is /share/locale/uk/LC_MESSAGES/bfd.mo for?
« Reply #1 on: February 03, 2019, 11:49:47 pm »
Code: [Select]
2019-01-30--07-36-22---2019-01-30--07-37-26 - [ dev-embedded/m68hc11-assembler ] - success - @2.29.1/7.3.0
2019-01-30--07-42-22---2019-01-30--07-56-28 - [ dev-embedded/m68hc11-binutils ] - success - @2.29.1/7.3.0
2019-01-30--08-07-40---2019-01-30--08-14-18 - [ dev-embedded/m68hc11-gcc ] - success - @2.29.1/7.3.0
2019-02-03--18-59-37---2019-02-03--20-13-22 - [ dev-embedded/riscv32-binutils ] - success - @2.29.1/7.3.0

I am finalizing the Overlay for the dev-embedded stuff


what if I simply remove these ".mo" files from the install procedure?

I don't understand what they are for, and which tool inside binutils should need them.


p.s.
I have also disabled some features
Code: [Select]
       # Disable modules that are in a combined binutils/gdb tree. #490566
       conf="$conf --disable-gdb "
       conf="$conf --disable-libdecnumber "
       conf="$conf --disable-sim "
       # Strip out broken static link flags.
       # https://gcc.gnu.org/PR56750
       conf="$conf --without-stage1-ldflags "
 

Offline amyk

  • Super Contributor
  • ***
  • Posts: 8415
Re: binutils, what is /share/locale/uk/LC_MESSAGES/bfd.mo for?
« Reply #2 on: February 04, 2019, 12:00:13 am »
Like the path says, they are the messages (text strings)the program prints out, if you delete those files either the program will become completely mute or might default to English (in which case you may omit the .mo files.)
 

Offline sleemanj

  • Super Contributor
  • ***
  • Posts: 3047
  • Country: nz
  • Professional tightwad.
    • The electronics hobby components I sell.
Re: binutils, what is /share/locale/uk/LC_MESSAGES/bfd.mo for?
« Reply #3 on: February 04, 2019, 02:06:09 am »
Compiled language translation files, see GNU gettext
~~~
EEVBlog Members - get yourself 10% discount off all my electronic components for sale just use the Buy Direct links and use Coupon Code "eevblog" during checkout.  Shipping from New Zealand, international orders welcome :-)
 

Offline legacyTopic starter

  • Super Contributor
  • ***
  • !
  • Posts: 4415
  • Country: ch
Re: binutils, what is /share/locale/uk/LC_MESSAGES/bfd.mo for?
« Reply #4 on: February 04, 2019, 11:29:11 am »
Compiled language translation files, see GNU gettext

thanks!

can these files be removed, or can binutils be compiled without them?

the reason I ask is simple: only these files make collisions for different toolchains, and this is a problem for Gentoo, specifically for the install procedure that needs a trick in order to avoid complete failure.

Collisions are assumed to be a BAD event for the sandbox during the processing.

Code: [Select]
# lsp /usr/idp/bin/*
      708 Kbyte /usr/idp/bin/m68hc11-elf-addr2line
      772 Kbyte /usr/idp/bin/m68hc11-elf-ar
        1 Mbyte /usr/idp/bin/m68hc11-elf-as
        3 Mbyte /usr/idp/bin/m68hc11-elf-cc1
      708 Kbyte /usr/idp/bin/m68hc11-elf-c++filt
      130 Kbyte /usr/idp/bin/m68hc11-elf-cpp
       65 Kbyte /usr/idp/bin/m68hc11-elf-elfedit
      837 Kbyte /usr/idp/bin/m68hc11-elf-gprof
        1 Mbyte /usr/idp/bin/m68hc11-elf-ld
        1 Mbyte /usr/idp/bin/m68hc11-elf-ld.bfd
      708 Kbyte /usr/idp/bin/m68hc11-elf-nm
      902 Kbyte /usr/idp/bin/m68hc11-elf-objcopy
        1 Mbyte /usr/idp/bin/m68hc11-elf-objdump
      772 Kbyte /usr/idp/bin/m68hc11-elf-ranlib
      581 Kbyte /usr/idp/bin/m68hc11-elf-readelf
      708 Kbyte /usr/idp/bin/m68hc11-elf-size
      708 Kbyte /usr/idp/bin/m68hc11-elf-strings
      902 Kbyte /usr/idp/bin/m68hc11-elf-strip
       70 Kbyte /usr/idp/bin/m68hc11-mos-as
       65 Kbyte /usr/idp/bin/m68hc11-mos-ld
      965 Kbyte /usr/idp/bin/riscv32-unknown-elf-addr2line
        1 Mbyte /usr/idp/bin/riscv32-unknown-elf-ar
        1 Mbyte /usr/idp/bin/riscv32-unknown-elf-as
      964 Kbyte /usr/idp/bin/riscv32-unknown-elf-c++filt
       65 Kbyte /usr/idp/bin/riscv32-unknown-elf-elfedit
        7 Mbyte /usr/idp/bin/riscv32-unknown-elf-gdb
        3 Kbyte /usr/idp/bin/riscv32-unknown-elf-gdb-add-index
        1 Mbyte /usr/idp/bin/riscv32-unknown-elf-gprof
        1 Mbyte /usr/idp/bin/riscv32-unknown-elf-ld
        1 Mbyte /usr/idp/bin/riscv32-unknown-elf-ld.bfd
      965 Kbyte /usr/idp/bin/riscv32-unknown-elf-nm
        1 Mbyte /usr/idp/bin/riscv32-unknown-elf-objcopy
        1 Mbyte /usr/idp/bin/riscv32-unknown-elf-objdump
        1 Mbyte /usr/idp/bin/riscv32-unknown-elf-ranlib
      774 Kbyte /usr/idp/bin/riscv32-unknown-elf-readelf
      965 Kbyte /usr/idp/bin/riscv32-unknown-elf-size
      965 Kbyte /usr/idp/bin/riscv32-unknown-elf-strings
        1 Mbyte /usr/idp/bin/riscv32-unknown-elf-strip

note that binaries have a prefix, but the GNU configure cannot do it for the *.mo files

Ideally, a workaround would look like this

Code: [Select]
lsp /usr/idp/share/locale/uk/LC_MESSAGES_hypothetical/*
      186 Kbyte /usr/idp/share/locale/uk/LC_MESSAGES/m68hc11-bfd.mo
      231 Kbyte /usr/idp/share/locale/uk/LC_MESSAGES/m68hc11-binutils.mo
      560 Kbyte /usr/idp/share/locale/uk/LC_MESSAGES/m68hc11-gas.mo
       12 Kbyte /usr/idp/share/locale/uk/LC_MESSAGES/m68hc11-gprof.mo
       73 Kbyte /usr/idp/share/locale/uk/LC_MESSAGES/m68hc11-ld.mo
       34 Kbyte /usr/idp/share/locale/uk/LC_MESSAGES/m68hc11-opcodes.mo
      249 Kbyte /usr/idp/share/locale/uk/LC_MESSAGES/riscv32-bfd.mo
      322 Kbyte /usr/idp/share/locale/uk/LC_MESSAGES/riscv32-binutils.mo
      665 Kbyte /usr/idp/share/locale/uk/LC_MESSAGES/riscv32-gas.mo
       12 Kbyte /usr/idp/share/locale/uk/LC_MESSAGES/riscv32-gprof.mo
      156 Kbyte /usr/idp/share/locale/uk/LC_MESSAGES/riscv32-ld.mo
       63 Kbyte /usr/idp/share/locale/uk/LC_MESSAGES/riscv32-opcodes.mo

the above was obtained by a manual script, sort of file rename, but this way a binary (gettext?) that needs to read the %.mo won't find it since it will look for a renamed.

so it should be done in the ./configure  for coherency :-//
 

Offline sleemanj

  • Super Contributor
  • ***
  • Posts: 3047
  • Country: nz
  • Professional tightwad.
    • The electronics hobby components I sell.
Re: binutils, what is /share/locale/uk/LC_MESSAGES/bfd.mo for?
« Reply #5 on: February 04, 2019, 11:34:27 am »
If you are only dealing in English (US english probably) you can probably do without them.


~~~
EEVBlog Members - get yourself 10% discount off all my electronic components for sale just use the Buy Direct links and use Coupon Code "eevblog" during checkout.  Shipping from New Zealand, international orders welcome :-)
 

Offline legacyTopic starter

  • Super Contributor
  • ***
  • !
  • Posts: 4415
  • Country: ch
Re: binutils, what is /share/locale/uk/LC_MESSAGES/bfd.mo for?
« Reply #6 on: February 04, 2019, 11:39:26 am »
Code: [Select]
       conf="$conf --without-included-gettext "
       conf="$conf --disable-nls "

I am trying this
 

Offline BloodyCactus

  • Frequent Contributor
  • **
  • Posts: 482
  • Country: us
    • Kråketær
Re: binutils, what is /share/locale/uk/LC_MESSAGES/bfd.mo for?
« Reply #7 on: February 04, 2019, 03:07:00 pm »
cant you just crosscompile the toolchain to be with --prefix=/usr/idp/ ? and just build all of it that way and its correct.
-- Aussie living in the USA --
 

Offline legacyTopic starter

  • Super Contributor
  • ***
  • !
  • Posts: 4415
  • Country: ch
Re: binutils, what is /share/locale/uk/LC_MESSAGES/bfd.mo for?
« Reply #8 on: February 04, 2019, 03:40:06 pm »
cant you just crosscompile the toolchain to be with --prefix=/usr/idp/ ? and just build all of it that way and its correct.

no, it's not correct. Gentoo forces a toolchain to be segregated in a specific prefix

e.g.
Code: [Select]
# gcc-config -l
 [1] hppa2.0-unknown-linux-gnu-4.1.2
 [2] hppa2.0-unknown-linux-gnu-4.2.4
 [3] hppa2.0-unknown-linux-gnu-4.4.7
 [4] hppa2.0-unknown-linux-gnu-4.9.3
 [5] hppa2.0-unknown-linux-gnu-5.4.0
 [6] hppa2.0-unknown-linux-gnu-6.4.0
 [7] hppa2.0-unknown-linux-gnu-7.3.0 *
 [8] hppa64-unknown-linux-gnu-4.9.4
 [9] hppa64-unknown-linux-gnu-6.4.0
 [10] hppa64-unknown-linux-gnu-7.3.0 *
 [11] m68hc11-elf-3.3.6 *
 [12] m68k-elf-4.1.2 *
 [13] m68k-unknown-linux-gnu-4.1.2 *
 [14] mips-unknown-linux-gnu-5.3.0 *
 [15] mips64-unknown-linux-gnu-5.3.0 *
 [16] powerpc-unknown-linux-gnu-5.3.0 *

it means --prefix is ={ /usr/hppa2.0-unknown-linux-gnu, /usr/hppa64-unknown-linux-gnu, /usr/m68hc11-elf, /usr/m68k-elf, /usr/m68k-unknown-linux-gnu, /usr/mips-unknown-linux-gnu, /usr/mips64-unknown-linux-gnu, /usr/powerpc-unknown-linux-gnu }

unfortunately, this approach depends on crossdev, which usually profiles for Linux

so these two toolchains need an override patch in order to force crossdev to avoid considering them as "sources" for "cross-emerging" tools  :palm:

Code: [Select]

 [11] m68hc11-elf-3.3.6 *
 [12] m68k-elf-4.1.2 *

anyway, in order to make my life easier, I am considering barebone toolchains as independent things, so they are not handled by crossdev (which does a great job, but it's too centralized and difficult to be handled when you want something "special")

In my case, --prefix=/usr/idp/ is in use and it causes collision with some files on different toolchains.

I want everything inside /usr/idp; all goes as it should, except { 68hc11, riscv, etc } with --prefix=/usr/idp/ all collide /usr/idp/share/*.mo files, and this is a problem for the sandbox since a collision is a bad event that makes the install process to fail.


Anyway, I have now hacked the Makefile, removed gdb, and other stuff, and now it's working as it should  :D


I had to
- to create a fake Gdb Makefile, because Gdb tries to compiles things which try to install crap
- to disable nls
- to disable gettext
« Last Edit: February 04, 2019, 03:48:40 pm by legacy »
 


Share me

Digg  Facebook  SlashDot  Delicious  Technorati  Twitter  Google  Yahoo
Smf