public inbox for cygwin@cygwin.com
 help / color / mirror / Atom feed
* Does Cygwin setup modify dlls?
@ 2017-09-22 14:00 Joachim Eibl
  2017-09-22 14:11 ` Eliot Moss
  2017-09-23 19:53 ` Achim Gratz
  0 siblings, 2 replies; 9+ messages in thread
From: Joachim Eibl @ 2017-09-22 14:00 UTC (permalink / raw)
  To: cygwin

Hi,
 
In our project we like the Cygwin-Setup tool so much that we use it for our own files too.
Adding our archives to our setup.ini was easy enough and almost everything worked as expected.
 
But then a certain tool didn't work and we found that dll-files that were unpacked by the Cygwin-installer didn't match the files in the archive.
The problem seems to be dll-specific. Other filetypes are not modified.
 
When unpacking using normal Cygwin-tools (tar xf ...) all files were correct. So somehow the installation via Cygwin modifies them.
 
Is this known behaviour? Is this intentional? Can it be turned off? (Is there some postprocessing like "strip" etc?)
Or do you think we have another kind of problem, that is not related to Cygwin?
 
Our Cygwin-setup-version is 2.877, x86_64, running on Windows 10 or Windows 7.
 
Best regards,
Joachim

--
Problem reports:       http://cygwin.com/problems.html
FAQ:                   http://cygwin.com/faq/
Documentation:         http://cygwin.com/docs.html
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple

^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: Does Cygwin setup modify dlls?
  2017-09-22 14:00 Does Cygwin setup modify dlls? Joachim Eibl
@ 2017-09-22 14:11 ` Eliot Moss
  2017-09-22 14:46   ` Marco Atzeri
  2017-09-23 19:53 ` Achim Gratz
  1 sibling, 1 reply; 9+ messages in thread
From: Eliot Moss @ 2017-09-22 14:11 UTC (permalink / raw)
  To: cygwin

On 9/22/2017 10:00 AM, Joachim Eibl wrote:
> Hi,
>   
> In our project we like the Cygwin-Setup tool so much that we use it for our own files too.
> Adding our archives to our setup.ini was easy enough and almost everything worked as expected.
>   
> But then a certain tool didn't work and we found that dll-files that were unpacked by the Cygwin-installer didn't match the files in the archive.
> The problem seems to be dll-specific. Other filetypes are not modified.
>   
> When unpacking using normal Cygwin-tools (tar xf ...) all files were correct. So somehow the installation via Cygwin modifies them.
>   
> Is this known behaviour? Is this intentional? Can it be turned off? (Is there some postprocessing like "strip" etc?)
> Or do you think we have another kind of problem, that is not related to Cygwin?
>   
> Our Cygwin-setup-version is 2.877, x86_64, running on Windows 10 or Windows 7.

Cygwin's rebasing of DLLs does modify the files (slightly).
Others can probably detail the exact nature of what changes,
and perhaps the comparison tool can be refined to ignore that
as a difference.

Regards - Eliot Moss

--
Problem reports:       http://cygwin.com/problems.html
FAQ:                   http://cygwin.com/faq/
Documentation:         http://cygwin.com/docs.html
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple

^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: Does Cygwin setup modify dlls?
  2017-09-22 14:11 ` Eliot Moss
@ 2017-09-22 14:46   ` Marco Atzeri
       [not found]     ` <trinity-4204847c-6bba-4606-b43c-8b376b96a945-1506094235587@3c-app-gmx-bs22>
  2017-09-22 15:49     ` Eliot Moss
  0 siblings, 2 replies; 9+ messages in thread
From: Marco Atzeri @ 2017-09-22 14:46 UTC (permalink / raw)
  To: cygwin

On 22/09/2017 16:11, Eliot Moss wrote:
> On 9/22/2017 10:00 AM, Joachim Eibl wrote:
>> Hi,
>> In our project we like the Cygwin-Setup tool so much that we use it 
>> for our own files too.
>> Adding our archives to our setup.ini was easy enough and almost 
>> everything worked as expected.
>> But then a certain tool didn't work and we found that dll-files that 
>> were unpacked by the Cygwin-installer didn't match the files in the 
>> archive.
>> The problem seems to be dll-specific. Other filetypes are not modified.

> 
> Cygwin's rebasing of DLLs does modify the files (slightly).
> Others can probably detail the exact nature of what changes,
> and perhaps the comparison tool can be refined to ignore that
> as a difference.

the change is on ImageBase address

$ objdump -x /usr/bin/cygglpk-40.dll |grep ImageBase
ImageBase               00000003e1710000

  $ rebase -si |grep  /usr/bin/cygglpk-40.dll
/usr/bin/cygglpk-40.dll 
                                       base 0x0003e1710000 size 0x000ec000

To perform a proper fork all the dlls should be loaded
at not colliding address

This activity is performed by the script
/etc/postinstall/0p_000_autorebase.dash

after the files installation.


> Regards - Eliot Moss

Regards
Marco


--
Problem reports:       http://cygwin.com/problems.html
FAQ:                   http://cygwin.com/faq/
Documentation:         http://cygwin.com/docs.html
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple

^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: Re: Does Cygwin setup modify dlls?
       [not found]     ` <trinity-4204847c-6bba-4606-b43c-8b376b96a945-1506094235587@3c-app-gmx-bs22>
@ 2017-09-22 15:31       ` Joachim Eibl
  2017-09-22 16:49         ` Marco Atzeri
  2017-09-27  4:50         ` Andrey Repin
  0 siblings, 2 replies; 9+ messages in thread
From: Joachim Eibl @ 2017-09-22 15:31 UTC (permalink / raw)
  To: cygwin

Thank you for your answers.

> This activity is performed by the script
> /etc/postinstall/0p_000_autorebase.dash

Is there a possibility to avoid the rebasing, e.g. for certain folders?
In my case the intention was to use the Cygwin installer only, but the files in the package are not dependent on cygwin libraries. So forking is not an issue.

Best regards,
Joachim

--
Problem reports:       http://cygwin.com/problems.html
FAQ:                   http://cygwin.com/faq/
Documentation:         http://cygwin.com/docs.html
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple

^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: Does Cygwin setup modify dlls?
  2017-09-22 14:46   ` Marco Atzeri
       [not found]     ` <trinity-4204847c-6bba-4606-b43c-8b376b96a945-1506094235587@3c-app-gmx-bs22>
@ 2017-09-22 15:49     ` Eliot Moss
  1 sibling, 0 replies; 9+ messages in thread
From: Eliot Moss @ 2017-09-22 15:49 UTC (permalink / raw)
  To: cygwin

On 9/22/2017 10:46 AM, Marco Atzeri wrote:
> On 22/09/2017 16:11, Eliot Moss wrote:
>> On 9/22/2017 10:00 AM, Joachim Eibl wrote:
>>> Hi,
>>> In our project we like the Cygwin-Setup tool so much that we use it for our own files too.
>>> Adding our archives to our setup.ini was easy enough and almost everything worked as expected.
>>> But then a certain tool didn't work and we found that dll-files that were unpacked by the 
>>> Cygwin-installer didn't match the files in the archive.
>>> The problem seems to be dll-specific. Other filetypes are not modified.
> 
>>
>> Cygwin's rebasing of DLLs does modify the files (slightly).
>> Others can probably detail the exact nature of what changes,
>> and perhaps the comparison tool can be refined to ignore that
>> as a difference.
> 
> the change is on ImageBase address
> 
> $ objdump -x /usr/bin/cygglpk-40.dll |grep ImageBase
> ImageBase               00000003e1710000

So, if the OP compared output of objdump ignoring the ImageBase difference,
would that be able to indicate that the DLL is "the same" for his purposes
of knowing whether an installation is equivalent in terms of versions,
releases, etc.?

EM

--
Problem reports:       http://cygwin.com/problems.html
FAQ:                   http://cygwin.com/faq/
Documentation:         http://cygwin.com/docs.html
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple

^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: Does Cygwin setup modify dlls?
  2017-09-22 15:31       ` Joachim Eibl
@ 2017-09-22 16:49         ` Marco Atzeri
  2017-09-27  4:50         ` Andrey Repin
  1 sibling, 0 replies; 9+ messages in thread
From: Marco Atzeri @ 2017-09-22 16:49 UTC (permalink / raw)
  To: cygwin

On 22/09/2017 17:31, Joachim Eibl wrote:
> Thank you for your answers.
> 
>> This activity is performed by the script
>> /etc/postinstall/0p_000_autorebase.dash
> 
> Is there a possibility to avoid the rebasing, e.g. for certain folders?
> In my case the intention was to use the Cygwin installer only, but the files in the package are not dependent on cygwin libraries. So forking is not an issue.
> 
> Best regards,
> Joachim
> 


setup does not perform rebase.

It is a post installation phase, performed by a special
package.

$ cygcheck -l _autorebase
/etc/postinstall/0p_000_autorebase.dash
/etc/preremove/_autorebase.sh
/usr/bin/rebase-trigger
/usr/bin/rebaselst
/usr/share/doc/Cygwin/_autorebase.README

If you are not installing on the cygwin tree I see no issue.

Otherwise you can consider to patch the "_autorebase" package
to exclude some files/trees

Regards
Marco

--
Problem reports:       http://cygwin.com/problems.html
FAQ:                   http://cygwin.com/faq/
Documentation:         http://cygwin.com/docs.html
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple

^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: Does Cygwin setup modify dlls?
  2017-09-22 14:00 Does Cygwin setup modify dlls? Joachim Eibl
  2017-09-22 14:11 ` Eliot Moss
@ 2017-09-23 19:53 ` Achim Gratz
  1 sibling, 0 replies; 9+ messages in thread
From: Achim Gratz @ 2017-09-23 19:53 UTC (permalink / raw)
  To: cygwin

Joachim Eibl writes:
> But then a certain tool didn't work and we found that dll-files that
> were unpacked by the Cygwin-installer didn't match the files in the
> archive.  The problem seems to be dll-specific. Other filetypes are
> not modified.

Anything that is packaged will be rebased by the _autorebase postinstall
script (by default just DLL, but you can also arrange for some PE falgs
to be set on executables).  Currently the handful of exceptions needed
within Cygwin are hard-coded into the rebase_pkg function, so you'll
have to patch that.


Regards,
Achim.
-- 
+<[Q+ Matrix-12 WAVE#46+305 Neuron microQkb Andromeda XTk Blofeld]>+

Wavetables for the Waldorf Blofeld:
http://Synth.Stromeko.net/Downloads.html#BlofeldUserWavetables

--
Problem reports:       http://cygwin.com/problems.html
FAQ:                   http://cygwin.com/faq/
Documentation:         http://cygwin.com/docs.html
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple

^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: Does Cygwin setup modify dlls?
  2017-09-22 15:31       ` Joachim Eibl
  2017-09-22 16:49         ` Marco Atzeri
@ 2017-09-27  4:50         ` Andrey Repin
  2017-09-27 10:04           ` Joachim Eibl
  1 sibling, 1 reply; 9+ messages in thread
From: Andrey Repin @ 2017-09-27  4:50 UTC (permalink / raw)
  To: Joachim Eibl, cygwin

Greetings, Joachim Eibl!

> Thank you for your answers.

>> This activity is performed by the script
>> /etc/postinstall/0p_000_autorebase.dash

> Is there a possibility to avoid the rebasing, e.g. for certain folders?
> In my case the intention was to use the Cygwin installer only, but the
> files in the package are not dependent on cygwin libraries. So forking is not an issue.

He did mean fork(2) call, not a "source code fork".
DLL rebase is necessary for Cygwin to run in first place.


-- 
With best regards,
Andrey Repin
Wednesday, September 27, 2017 07:35:39

Sorry for my terrible english...


--
Problem reports:       http://cygwin.com/problems.html
FAQ:                   http://cygwin.com/faq/
Documentation:         http://cygwin.com/docs.html
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple

^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: Re: Does Cygwin setup modify dlls?
  2017-09-27  4:50         ` Andrey Repin
@ 2017-09-27 10:04           ` Joachim Eibl
  0 siblings, 0 replies; 9+ messages in thread
From: Joachim Eibl @ 2017-09-27 10:04 UTC (permalink / raw)
  To: cygwin

Thanks for all answers.
 
We will patch /usr/bin/rebaselst and extend the sed-expression in function rebase_pkg()
by adding another exception to the existing ones:
 
      sed -e '/\(cygwin1\|cyglsa.*\)\.dll$/d' \
          -e '/\/\(d\?ash|rebase\|peflags\)\.exe$/d' \
          -e '/\/octave\//!{/\(mex\|oct\)$/d}' \
          -e '/gnuplot\/demo\/plugin\/.*\.so/d' \
          -e '/^\/usr\/lib\/ocaml\/.*\.so/d' \
          -e '/sys-root\/mingw/d' \
+         -e '/our-subdir/d' \
          -e 's/^/\//' \
          >>"${g}"
 
 
> > Is there a possibility to avoid the rebasing, e.g. for certain folders?
> > In my case the intention was to use the Cygwin installer only, but the
> > files in the package are not dependent on cygwin libraries. So forking is not an issue.

> He did mean fork(2) call, not a "source code fork".
> DLL rebase is necessary for Cygwin to run in first place.
 
I understood this. The tools we install aren't run in a cygwin-context.
 
Best regards,
Joachim

--
Problem reports:       http://cygwin.com/problems.html
FAQ:                   http://cygwin.com/faq/
Documentation:         http://cygwin.com/docs.html
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple

^ permalink raw reply	[flat|nested] 9+ messages in thread

end of thread, other threads:[~2017-09-27 10:04 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-09-22 14:00 Does Cygwin setup modify dlls? Joachim Eibl
2017-09-22 14:11 ` Eliot Moss
2017-09-22 14:46   ` Marco Atzeri
     [not found]     ` <trinity-4204847c-6bba-4606-b43c-8b376b96a945-1506094235587@3c-app-gmx-bs22>
2017-09-22 15:31       ` Joachim Eibl
2017-09-22 16:49         ` Marco Atzeri
2017-09-27  4:50         ` Andrey Repin
2017-09-27 10:04           ` Joachim Eibl
2017-09-22 15:49     ` Eliot Moss
2017-09-23 19:53 ` Achim Gratz

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).