Re: Troubleshooting building Swift on Fedora, take 2; assembly language is not my friend

2022-03-30 Thread Ron Olson
That was it! I somehow missed that change to the macros and undermining 
_auto_set_build_flags fixed it. Thanks!


On 29 Mar 2022, at 4:38, Sérgio Basto wrote:


On Mon, 2022-03-28 at 16:43 -0500, Ron Olson wrote:

Hey all-
I’m unable to build Swift on Fedora 36 and Rawhide while it does
build on F35. I’ve been able to condense the entire issue down to 
the

following sample code that demonstrates the problem:
nothing.S:
#define ASM_TYPE_FUNCTION(symbol) .type symbol, %function
#define ASM_SIZE(symbol) .size symbol, .-symbol
#define ASM_SYMBOL(symbol) symbol
#define ASM_WRAPPER_NAME(symbol) _interceptor##symbol
.comm _ZN14__interception10real_vforkE,8,8
.globl ASM_WRAPPER_NAME(vfork)
ASM_TYPE_FUNCTION(ASM_WRAPPER_NAME(vfork))
ASM_WRAPPER_NAME(vfork):
// Commenting out the line below makes it work
call *_ZN14__interception10real_vforkE(%rip)
ASM_SIZE(vfork)
And compiling this code with:
clang++ -fPIC -shared ./nothing.S
Results in the error:
/usr/bin/ld: /tmp/fun-1b3a0d.o: warning: relocation against
_ZN14__interception10real_vforkE' in read-only section .text'
/usr/bin/ld: /tmp/fun-1b3a0d.o: relocation R_X86_64_PC32 against
symbol `_ZN14__interception10real_vforkE' can not be used when making
a shared object; recompile with -fPIC
/usr/bin/ld: final link failed: bad value



https://bugzilla.redhat.com/show_bug.cgi?id=1304277#c3

"relocation R_X86_64_PC32 against undefined symbol" happens when
LDFLAGS are set with hardening and CFLAGS not .

maybe is an effect
of https://fedoraproject.org/wiki/Changes/SetBuildFlagsBuildCheck have
you tried %undefine _auto_set_build_flags ?


The issue is that I’m explicitly passing -fPIC but it seems to 
either
be ignored or overridden somehow. I’m not well versed on assembly 
to

make any kind of educated guess about what might be the
problem/solution so I’m hoping someone more familiar might be able 
to

shed some light on the issue.
Thanks!
Ron
___
devel mailing list -- devel@lists.fedoraproject.org
To unsubscribe send an email to devel-le...@lists.fedoraproject.org
Fedora Code of Conduct:
https://docs.fedoraproject.org/en-US/project/code-of-conduct/
List Guidelines:
https://fedoraproject.org/wiki/Mailing_list_guidelines
List Archives:
https://lists.fedoraproject.org/archives/list/devel@lists.fedoraproject.org
Do not reply to spam on the list, report it:
https://pagure.io/fedora-infrastructure


--
Sérgio M. B.



___
devel mailing list -- devel@lists.fedoraproject.org
To unsubscribe send an email to devel-le...@lists.fedoraproject.org
Fedora Code of Conduct: 
https://docs.fedoraproject.org/en-US/project/code-of-conduct/
List Guidelines: 
https://fedoraproject.org/wiki/Mailing_list_guidelines
List Archives: 
https://lists.fedoraproject.org/archives/list/devel@lists.fedoraproject.org
Do not reply to spam on the list, report it: 
https://pagure.io/fedora-infrastructure___
devel mailing list -- devel@lists.fedoraproject.org
To unsubscribe send an email to devel-le...@lists.fedoraproject.org
Fedora Code of Conduct: 
https://docs.fedoraproject.org/en-US/project/code-of-conduct/
List Guidelines: https://fedoraproject.org/wiki/Mailing_list_guidelines
List Archives: 
https://lists.fedoraproject.org/archives/list/devel@lists.fedoraproject.org
Do not reply to spam on the list, report it: 
https://pagure.io/fedora-infrastructure


Re: Troubleshooting building Swift on Fedora, take 2; assembly language is not my friend

2022-03-29 Thread Sérgio Basto
On Mon, 2022-03-28 at 16:43 -0500, Ron Olson wrote:
> Hey all-
> I’m unable to build Swift on Fedora 36 and Rawhide while it does
> build on F35. I’ve been able to condense the entire issue down to the
> following sample code that demonstrates the problem:
> nothing.S:
> #define ASM_TYPE_FUNCTION(symbol) .type symbol, %function
> #define ASM_SIZE(symbol) .size symbol, .-symbol
> #define ASM_SYMBOL(symbol) symbol
> #define ASM_WRAPPER_NAME(symbol) _interceptor##symbol
> .comm _ZN14__interception10real_vforkE,8,8
> .globl ASM_WRAPPER_NAME(vfork)
> ASM_TYPE_FUNCTION(ASM_WRAPPER_NAME(vfork))
> ASM_WRAPPER_NAME(vfork):
> // Commenting out the line below makes it work
> call *_ZN14__interception10real_vforkE(%rip)
> ASM_SIZE(vfork)
> And compiling this code with:
> clang++ -fPIC -shared ./nothing.S
> Results in the error:
> /usr/bin/ld: /tmp/fun-1b3a0d.o: warning: relocation against
> _ZN14__interception10real_vforkE' in read-only section .text'
> /usr/bin/ld: /tmp/fun-1b3a0d.o: relocation R_X86_64_PC32 against
> symbol `_ZN14__interception10real_vforkE' can not be used when making
> a shared object; recompile with -fPIC
> /usr/bin/ld: final link failed: bad value


https://bugzilla.redhat.com/show_bug.cgi?id=1304277#c3

"relocation R_X86_64_PC32 against undefined symbol" happens when
LDFLAGS are set with hardening and CFLAGS not .

maybe is an effect
of https://fedoraproject.org/wiki/Changes/SetBuildFlagsBuildCheck have
you tried %undefine _auto_set_build_flags ?
 

> The issue is that I’m explicitly passing -fPIC but it seems to either
> be ignored or overridden somehow. I’m not well versed on assembly to
> make any kind of educated guess about what might be the
> problem/solution so I’m hoping someone more familiar might be able to
> shed some light on the issue.
> Thanks!
> Ron
> ___
> devel mailing list -- devel@lists.fedoraproject.org
> To unsubscribe send an email to devel-le...@lists.fedoraproject.org
> Fedora Code of Conduct:
> https://docs.fedoraproject.org/en-US/project/code-of-conduct/
> List Guidelines:
> https://fedoraproject.org/wiki/Mailing_list_guidelines
> List Archives:
> https://lists.fedoraproject.org/archives/list/devel@lists.fedoraproject.org
> Do not reply to spam on the list, report it:
> https://pagure.io/fedora-infrastructure

-- 
Sérgio M. B.
___
devel mailing list -- devel@lists.fedoraproject.org
To unsubscribe send an email to devel-le...@lists.fedoraproject.org
Fedora Code of Conduct: 
https://docs.fedoraproject.org/en-US/project/code-of-conduct/
List Guidelines: https://fedoraproject.org/wiki/Mailing_list_guidelines
List Archives: 
https://lists.fedoraproject.org/archives/list/devel@lists.fedoraproject.org
Do not reply to spam on the list, report it: 
https://pagure.io/fedora-infrastructure


Re: Troubleshooting building Swift on Fedora, take 2; assembly language is not my friend

2022-03-28 Thread Jerry James
On Mon, Mar 28, 2022 at 3:44 PM Ron Olson  wrote:
> I’m unable to build Swift on Fedora 36 and Rawhide while it does build on 
> F35. I’ve been able to condense the entire issue down to the following sample 
> code that demonstrates the problem:

This looks like
https://stackoverflow.com/questions/48369771/relocation-r-x86-64-pc32-against-symbol-when-calling-function-from-inline-assemb.
-- 
Jerry James
http://www.jamezone.org/
___
devel mailing list -- devel@lists.fedoraproject.org
To unsubscribe send an email to devel-le...@lists.fedoraproject.org
Fedora Code of Conduct: 
https://docs.fedoraproject.org/en-US/project/code-of-conduct/
List Guidelines: https://fedoraproject.org/wiki/Mailing_list_guidelines
List Archives: 
https://lists.fedoraproject.org/archives/list/devel@lists.fedoraproject.org
Do not reply to spam on the list, report it: 
https://pagure.io/fedora-infrastructure


Re: Troubleshooting building Swift on Fedora, take 2; assembly language is not my friend

2022-03-28 Thread Demi Marie Obenour
On 3/28/22 17:43, Ron Olson wrote:
> Hey all-
> 
> I’m unable to build Swift on Fedora 36 and Rawhide while it does build 
> on F35. I’ve been able to condense the entire issue down to the 
> following sample code that demonstrates the problem:

Does using lld or gold help?

-- 
Sincerely,
Demi Marie Obenour (she/her/hers)

OpenPGP_0xB288B55FFF9C22C1.asc
Description: OpenPGP public key


OpenPGP_signature
Description: OpenPGP digital signature
___
devel mailing list -- devel@lists.fedoraproject.org
To unsubscribe send an email to devel-le...@lists.fedoraproject.org
Fedora Code of Conduct: 
https://docs.fedoraproject.org/en-US/project/code-of-conduct/
List Guidelines: https://fedoraproject.org/wiki/Mailing_list_guidelines
List Archives: 
https://lists.fedoraproject.org/archives/list/devel@lists.fedoraproject.org
Do not reply to spam on the list, report it: 
https://pagure.io/fedora-infrastructure


Re: Troubleshooting building Swift on Fedora, take 2; assembly language is not my friend

2022-03-28 Thread Ron Olson

FWIW, I get the same result if using GCC.

On 28 Mar 2022, at 16:43, Ron Olson wrote:


Hey all-

I’m unable to build Swift on Fedora 36 and Rawhide while it does 
build on F35. I’ve been able to condense the entire issue down to 
the following sample code that demonstrates the problem:


nothing.S:

#define ASM_TYPE_FUNCTION(symbol) .type symbol, %function
#define ASM_SIZE(symbol) .size symbol, .-symbol
#define ASM_SYMBOL(symbol) symbol
#define ASM_WRAPPER_NAME(symbol) __interceptor_##symbol

.comm _ZN14__interception10real_vforkE,8,8
.globl ASM_WRAPPER_NAME(vfork)
ASM_TYPE_FUNCTION(ASM_WRAPPER_NAME(vfork))
ASM_WRAPPER_NAME(vfork):
// Commenting out the line below makes it work
call*_ZN14__interception10real_vforkE(%rip)
ASM_SIZE(vfork)

And compiling this code with:

clang++ -fPIC -shared ./nothing.S

Results in the error:

/usr/bin/ld: /tmp/fun-1b3a0d.o: warning: relocation against 
`_ZN14__interception10real_vforkE' in read-only section `.text'
/usr/bin/ld: /tmp/fun-1b3a0d.o: relocation R_X86_64_PC32 against 
symbol `_ZN14__interception10real_vforkE' can not be used when making 
a shared object; recompile with -fPIC

/usr/bin/ld: final link failed: bad value

The issue is that I’m explicitly passing -fPIC but it seems to 
either be ignored or overridden somehow. I’m not well versed on 
assembly to make any kind of educated guess about what might be the 
problem/solution so I’m hoping someone more familiar might be able 
to shed some light on the issue.


Thanks!

Ron___
devel mailing list -- devel@lists.fedoraproject.org
To unsubscribe send an email to devel-le...@lists.fedoraproject.org
Fedora Code of Conduct: 
https://docs.fedoraproject.org/en-US/project/code-of-conduct/
List Guidelines: https://fedoraproject.org/wiki/Mailing_list_guidelines
List Archives: 
https://lists.fedoraproject.org/archives/list/devel@lists.fedoraproject.org
Do not reply to spam on the list, report it: 
https://pagure.io/fedora-infrastructure


Troubleshooting building Swift on Fedora, take 2; assembly language is not my friend

2022-03-28 Thread Ron Olson

Hey all-

I’m unable to build Swift on Fedora 36 and Rawhide while it does build 
on F35. I’ve been able to condense the entire issue down to the 
following sample code that demonstrates the problem:


nothing.S:

#define ASM_TYPE_FUNCTION(symbol) .type symbol, %function
#define ASM_SIZE(symbol) .size symbol, .-symbol
#define ASM_SYMBOL(symbol) symbol
#define ASM_WRAPPER_NAME(symbol) __interceptor_##symbol

.comm _ZN14__interception10real_vforkE,8,8
.globl ASM_WRAPPER_NAME(vfork)
ASM_TYPE_FUNCTION(ASM_WRAPPER_NAME(vfork))
ASM_WRAPPER_NAME(vfork):
// Commenting out the line below makes it work
call*_ZN14__interception10real_vforkE(%rip)
ASM_SIZE(vfork)

And compiling this code with:

clang++ -fPIC -shared ./nothing.S

Results in the error:

/usr/bin/ld: /tmp/fun-1b3a0d.o: warning: relocation against 
`_ZN14__interception10real_vforkE' in read-only section `.text'
/usr/bin/ld: /tmp/fun-1b3a0d.o: relocation R_X86_64_PC32 against symbol 
`_ZN14__interception10real_vforkE' can not be used when making a shared 
object; recompile with -fPIC

/usr/bin/ld: final link failed: bad value

The issue is that I’m explicitly passing -fPIC but it seems to either 
be ignored or overridden somehow. I’m not well versed on assembly to 
make any kind of educated guess about what might be the problem/solution 
so I’m hoping someone more familiar might be able to shed some light 
on the issue.


Thanks!

Ron___
devel mailing list -- devel@lists.fedoraproject.org
To unsubscribe send an email to devel-le...@lists.fedoraproject.org
Fedora Code of Conduct: 
https://docs.fedoraproject.org/en-US/project/code-of-conduct/
List Guidelines: https://fedoraproject.org/wiki/Mailing_list_guidelines
List Archives: 
https://lists.fedoraproject.org/archives/list/devel@lists.fedoraproject.org
Do not reply to spam on the list, report it: 
https://pagure.io/fedora-infrastructure