• This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn more.

About FreeBSD multi-arch.

marino

Daemon

Thanks: 413
Messages: 1,044

#51
ASX@
--gc-sections isn't equivalent to "smart-linking" either. I don't know fredvs is thinking here. I guess he's just looking for descriptions in the man page that sort of, kind of sound like it's the same thing.

I cease to care though. He's speaking with the disdainful authority of an expert while having no idea of what he's talking about. It's a bad combination.

I would have been interested in helping to identify and fix the smart link problem, perhaps with the help of the FPC developers, but not anymore. I'll just wait for a patch (and ignore the cracks about FPC packages being "unusable" without any evidence nor PRs written against them)
 

ASX

Guest


#52
marino@ Thanks, I know what is "garbage collection" and that it is totally out of context, and it is part of the reasons why in my previous message I deliberately choose to not discuss technical aspects.

I would have been interested in helping to identify and fix the smart link problem
Yes, that was very clear, to me at least.
 

fredvs

Active Member

Thanks: 17
Messages: 199

#53
ASX@
--gc-sections isn't equivalent to "smart-linking" either.
fpc -XX -s test.pas => (parameter -s makes a script for ld) => /usr/bin/ld -b elf32-i386-freebsd -m elf_i386_fbsd --gc-sections -s -L. -0 ./test ./link.res

ASX@
I would have been interested in helping to identify and fix the smart link problem
No, the only thing you want was to prove that I was wrong.
And I am not, ld has a problem with --gc-sections .

Fre;D
 

ASX

Guest


#56
So what ? What has that to do with your comment about marino@ intentions ?

By the way, because it seems you don't get it, FPC smartlinking is applied upon sources at compile stage, not at linking stage.

From the docs you linked before:
http://www.freepascal.org/docs-html/current/prog/progse30.html#x196-2010007.3

"Technically speaking, the compiler makes small assembler files for each procedure and function in the unit, as well as for all global defined variables (whether they’re in the interface section or not). It then assembles all these small files, and uses ar to collect the resulting object files in one archive."

It is also implied, that "smartlinking" refer to static-linking:
"Smartlinking and the creation of shared (or dynamic) libraries are mutually exclusive"

The ld --gc-sections flags has nothing to do with FPC smartlinking, nor exists a concept like "C program smartlinking", no matter how many time you write that.
 

fredvs

Active Member

Thanks: 17
Messages: 199

#57
So what ? What has that to do with your comment about marino@ intentions ?

By the way, because it seems you don't get it, FPC smartlinking is applied upon sources at compile stage, not at linking stage.

From the docs you linked before:
http://www.freepascal.org/docs-html/current/prog/progse30.html#x196-2010007.3

"Technically speaking, the compiler makes small assembler files for each procedure and function in the unit, as well as for all global defined variables (whether they’re in the interface section or not). It then assembles all these small files, and uses ar to collect the resulting object files in one archive."

It is also implied, that "smartlinking" refer to static-linking:
"Smartlinking and the creation of shared (or dynamic) libraries are mutually exclusive"

The ld --gc-sections flags has nothing to do with FPC smartlinking, nor exists a concept like "C program smartlinking", no matter how many time you write that.
I am really tired.

Please, read what follow slowly.

fpc -XX (smart-linking) does what you explained but to do this, that -XX parameter also add --gc-sections option to the linker.

You may check it easily with the -s parameter of fpc.

It will create a ppas.sh file that you may use for the linker:

fpc -XX -s test.pas ==> ppas.sh ==>

Code:
#!/bin/sh
DoExitAsm ()
{ echo "An error occurred while assembling $1"; exit 1; }
DoExitLink ()
{ echo "An error occurred while linking $1"; exit 1; }
echo Linking ./test
OFS=$IFS
IFS="
"
/usr/bin/ld -b elf32-i386-freebsd -m elf_i386_fbsd --gc-sections -s -L. -o ./test ./link.res
if [ $? != 0 ]; then DoExitLink ./test; fi
IFS=$OFS
From the script:

/usr/bin/ld -b elf32-i386-freebsd -m elf_i386_fbsd --gc-sections -s -L. -o ./test ./link.res

This because garbage collection must be enabled to do smartlinking.

One of the result of smartlinking (and it is mainly what wanted) is to (from doc) "This will result in a smaller binary".

All I want to prove is that --gc-sections option parsed to ld when smartlinking cause that a 32 bit application cannot run on a multi-arch system.

Please, we are no ennemies.

Fre;D
 

marino

Daemon

Thanks: 413
Messages: 1,044

#58
I am really tired.

Please, read what follow slowly.
Please, we are no ennemies.
You say you "aren't enemies" but you're speaking in an insulting, condescending tone.

It doesn't matter if your understanding of how --gc-sections is lacking, because if ASX@ is like me, he's "tired" of this topic too.
You said you were not going to reply any more. We've tried different approaches but you don't accept any of them, so that's fine, just let it die. You can continue to believe we are all morons, that's fine with us.
 

fredvs

Active Member

Thanks: 17
Messages: 199

#59
but you're speaking in an insulting, condescending tone.
I apologize, really it is not wanted.
I seems like this maybe because I speak French.

OK, to let die the problem.

PS: But I will fix the --gc-sections problem of ld 32 bit for my own purpose then.

Fre;D